Discuss Scratch

gabopr07
Scratcher
3 posts

Keeping Objects In place

Hi there,
I am trying to recreate Chapter 1 of Bendy And the Ink Machine as a top-down RPG however when trying to program the little objects you need to get to turn on the machine the objects wont stay where they need to be. they keep moving around whenever the player moves. Just so you know the map itself moves while Henry (the player simply plays an animation of him walking in that direction, that way he stays in the center of the screen whilst also moving kinda how the player moves in pokemon when they are either outside or in a really big area. Please help Without this program I might have to remove the object finding mechanic altogether and I have already created a bunch of sprites for this and I would also have to alter the map layout in order to remove this mechanic completely and that would take to long so PLEASE HELP!!!
deck26
Scratcher
1000+ posts

Keeping Objects In place

You'd be better learning how to do scrolling. The problem with getting all the objects to respond to the movement keys is that they get to the point where they no longer move - so they stay still and other things move. Then when you move in the opposite direction everything moves so the relative positions get messed up.

Look at the wiki pages on Scrolling for more info. Then my project here https://scratch.mit.edu/projects/92682141/ may help.
gabopr07
Scratcher
3 posts

Keeping Objects In place

This is not what I meant…
deck26
Scratcher
1000+ posts

Keeping Objects In place

Really? If the world moves you need to move any objects that move with the world. That's what you seem to be describing.
gabopr07
Scratcher
3 posts

Keeping Objects In place

yes but i want them to specifically stay in place even if they go of screen
deck26
Scratcher
1000+ posts

Keeping Objects In place

I'm confused.

If you want the objects to retain their ‘real world’ position you need to use variables to record that. The x and y position of the object is not enough if the object is trying to move beyond the edge of the screen as any changes you make will be undone by Scratch.

So by ‘stay in place’ do you mean in ‘real world’ terms? Scrolling manages that.
carteradams123
Scratcher
49 posts

Keeping Objects In place

deck26 wrote:

I'm confused.

If you want the objects to retain their ‘real world’ position you need to use variables to record that. The x and y position of the object is not enough if the object is trying to move beyond the edge of the screen as any changes you make will be undone by Scratch.

So by ‘stay in place’ do you mean in ‘real world’ terms? Scrolling manages that.

im necroposting here, but this is not really confusing.
he wants objects to stay in their original location even when the character moves away from them.
say you have a tree in a top-down game world. when you move your character (which is really moving the map and the tree) in a way that pushes the tree out of the screen, the tree follows you along the edge of the screen instead of waiting in it's spot on the map.

he is wondering how to keep this tree in its spot, and to not follow the character as it moves along the edge

I am either working hard or hardly working.
enderjack52
Scratcher
7 posts

Keeping Objects In place

I think he means show him the code..
1O1Andrew
Scratcher
100+ posts

Keeping Objects In place

enderjack52 wrote:

I think he means show him the code..
Please dont necropost

Don't do SAND. SAND has four words.
SAND means Spam, Advertising, Necroposting, and Derailing.
Spam means posting something unrelated. Wiki Article: Spam
Advertising is when you promote your studios and projects. Wiki Article: Advertising
Necroposting is when you post on a old topic. It distracts other helpers! Wiki Article: Necroposting
Derailing is when you post something that leads others away from the topic. It is called thread hijacking. Wiki Article: Derailing


Powered by DjangoBB