Discuss Scratch

hmdmner
Scratcher
24 posts

How does the "move () steps" block work, this will help with a game I am debugging?

I would like to see how I can calculate the X and Y positions after something has move in some steps in any given direction.
Can any of you help me?
define hmdmner
hmdmner

hmdmner
deck26
Scratcher
1000+ posts

How does the "move () steps" block work, this will help with a game I am debugging?

Every object has its own x-position and y-position variables which can be found in the movement section. So when you move the sprite you can easily obtain the new position.
hmdmner
Scratcher
24 posts

How does the "move () steps" block work, this will help with a game I am debugging?

But how do I predict what they would be?
doodthedoodthedood
Scratcher
500+ posts

How does the "move () steps" block work, this will help with a game I am debugging?

Use the
(x position) and (y position)
blocks to tell where the sprite is.
deck26
Scratcher
1000+ posts

How does the "move () steps" block work, this will help with a game I am debugging?

hmdmner wrote:

But how do I predict what they would be?
If you want to predict the change in x and y for movement in a direction D you can use trigonometry but you might find it easier just to use another sprite to start at the player and do a test movement - you can then see where it ends up to get the end position.
asivi
Scratcher
1000+ posts

How does the "move () steps" block work, this will help with a game I am debugging?

You can make it move in a custom block running without screen refresh firstly, anotate coordinates and go back to previous position.
Edmundv1
Scratcher
21 posts

How does the "move () steps" block work, this will help with a game I am debugging?

the move () steps is just
change x by (([sin v] of (direction)) * (steps))
change y by (([cos v] of (direction)) * (steps))

Last edited by Edmundv1 (Oct. 9, 2023 16:26:18)

AGScratcherBest
Scratcher
100+ posts

How does the "move () steps" block work, this will help with a game I am debugging?

Edmundv1 wrote:

(#7)
the move () steps is just
change x by (([sin v] of (direction)) * (steps))
change y by (([cos v] of (direction)) * (steps))
// NECROPOSTING //


Look at the date of the last post…
Frisk-256
Scratcher
70 posts

How does the "move () steps" block work, this will help with a game I am debugging?

AGScratcherBest wrote:

Edmundv1 wrote:

(#7)
the move () steps is just
change x by (([sin v] of (direction)) * (steps))
change y by (([cos v] of (direction)) * (steps))
// NECROPOSTING //


Look at the date of the last post…
what is necroposting?
Jlerpy
Scratcher
1000+ posts

How does the "move () steps" block work, this will help with a game I am debugging?

Frisk-256 wrote:

what is necroposting?

Replying to really old threads, bringing them back to the top of the page. It's assist the rules of the forums.
aboumerhy
Scratcher
3 posts

How does the "move () steps" block work, this will help with a game I am debugging?

Edmundv1 wrote:

the move () steps is just
change x by (([sin v] of (direction)) * (steps))
change y by (([cos v] of (direction)) * (steps))
ty
i needed the math in one of my python projects, this really helped

Last edited by aboumerhy (Oct. 2, 2025 06:22:33)

Powered by DjangoBB