Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How does the "move () steps" block work, this will help with a game I am debugging?
- hmdmner
-
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?
Can any of you help me?
define hmdmner
hmdmner
hmdmner
- deck26
-
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
-
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
-
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
-
1000+ posts
How does the "move () steps" block work, this will help with a game I am debugging?
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. But how do I predict what they would be?
- asivi
-
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
-
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
-
100+ posts
How does the "move () steps" block work, this will help with a game I am debugging?
(#7)
the move () steps is justchange 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
-
70 posts
How does the "move () steps" block work, this will help with a game I am debugging?
what is necroposting?(#7)
the move () steps is justchange x by (([sin v] of (direction)) * (steps))
change y by (([cos v] of (direction)) * (steps))// NECROPOSTING //
Look at the date of the last post…
- Jlerpy
-
1000+ posts
How does the "move () steps" block work, this will help with a game I am debugging?
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
-
3 posts
How does the "move () steps" block work, this will help with a game I am debugging?
ty the move () steps is justchange x by (([sin v] of (direction)) * (steps))
change y by (([cos v] of (direction)) * (steps))
i needed the math in one of my python projects, this really helped
Last edited by aboumerhy (Oct. 2, 2025 06:22:33)
- Discussion Forums
- » Help with Scripts
-
» How does the "move () steps" block work, this will help with a game I am debugging?