Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How do I stop the sprite from moving?
- squirrel719
-
Scratcher
69 posts
How do I stop the sprite from moving?
Hello, is there any way to stop the sprite from moving, a block like;
If Spacebar key pressed,
Freeze sprite1
If Spacebar key pressed,
Freeze sprite1
- Sonickyle
-
Scratcher
1000+ posts
How do I stop the sprite from moving?
if <(Freezed) = [0]> then
...
end
- Paddle2See
-
Scratch Team
1000+ posts
How do I stop the sprite from moving?
Assuming you have a motion loop something like on the sprite,
then, this might do the trick, without needing a variable
when green flag clicked
forever
move (2) steps
if on edge, bounce
end
then, this might do the trick, without needing a variable
when [space v] key pressed
stop [other scripts in sprite v]
Last edited by Paddle2See (June 8, 2014 14:18:51)
- RPFluffy
-
Scratcher
1000+ posts
How do I stop the sprite from moving?
That is a great question but you will soon see that having infinite loops aren't always the way to go so you can do this instead:
when green flag clicked
repeat until <key [space v] pressed?>
move (10) steps
if on edge, bounce
end
- RPFluffy
-
Scratcher
1000+ posts
How do I stop the sprite from moving?
if <(Freezed) = [0]> then
...
end
This is a lot more complex, not suggested

- digthebone
-
Scratcher
500+ posts
How do I stop the sprite from moving?
when green flag clicked
repeat (how much times you want it to repeat)
move (how much steps you want it to step) steps
end
stop [this script v]
hopefully that hlped!

and always remember
when green flag clicked
forever
if <got help from digthebone> then
know he is awesome
end
end
digthebone's logo shop
- sethicus2000
-
Scratcher
1 post
How do I stop the sprite from moving?
what about when you press space bar (excess characters removed by moderator - please don't spam)
Last edited by Paddle2See (Nov. 3, 2016 18:39:49)
- amylaser
-
Scratcher
500+ posts
How do I stop the sprite from moving?
If you want the sprite to be able to move once you release the spacebar, you will need a forever loop. Like so…
when green flag clicked
forever
if <not <key [space v] pressed?>> then
move (10) steps
turn cw (15) degrees
end
- Gilstylin
-
Scratcher
99 posts
How do I stop the sprite from moving?
nvm
Last edited by Gilstylin (Sept. 24, 2017 23:20:10)
- -frostyiceprincess-
-
Scratcher
1000+ posts
How do I stop the sprite from moving?
nvmPlease don't necropost, I'll report to be closed.
- Discussion Forums
- » Help with Scripts
-
» How do I stop the sprite from moving?








