Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Need help creating movement for my sprite.
- Gumbleville_online
-
Scratcher
5 posts
Need help creating movement for my sprite.
I need help creating a simple set of rules that will allow my sprite to move up, down, left, and right (in a flat 2d table top style chess board layout), except if there is a wall in the way. Additionally, once the sprite has started moving, it should only stop once it hits a wall. Similar to the game mechanic in the app pudding monsters by zepto lab.
- codeman1044
-
Scratcher
1000+ posts
Need help creating movement for my sprite.
Could you explain what you have so far? There's nothing saying what you already have, just what you have in mind.
Last edited by codeman1044 (March 4, 2020 01:32:26)
- Gumbleville_online
-
Scratcher
5 posts
Need help creating movement for my sprite.

Here's what I've got so far. Of course the issue here is that it doesnt stop the person from going through the wall.
- codeman1044
-
Scratcher
1000+ posts
Need help creating movement for my sprite.
After the repeat until, add a move -1 steps block:
if <<key [ v] pressed?> and <touching color [#000000]?>> thenas a side note, color blocks are very laggy. Keep this in mind while making your project.
repeat until <touching color [#000000]?>
move (1) steps
end
move (-1) steps
- Discussion Forums
- » Help with Scripts
-
» Need help creating movement for my sprite.