Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Stop sprites from moving for a few seconds.
- Swampat
-
25 posts
Stop sprites from moving for a few seconds.
I'm trying to stop the mouse sprites after the hammer power up is touched. I want them to stop moving for a few seconds and then make them move again. If you have any ideas let me know.
Project: https://scratch.mit.edu/projects/175357890/
Project: https://scratch.mit.edu/projects/175357890/
- mstone326
-
1000+ posts
Stop sprites from moving for a few seconds.
When you touch the hammer broadcast a message called freeze or something like that. You'll also have to create a variable to handle whether a script will run. The difficult part is all your repeat until loops that handle your movement. So you'll have to put the move condition inside each of your repeat until blocks.I put a comment tag on all the code I created as well as the new variable and broadcast. All changes are on mouse2 and hammer
I remixed with one done for you.
https://scratch.mit.edu/projects/222825647/
I remixed with one done for you.
https://scratch.mit.edu/projects/222825647/
- deck26
-
1000+ posts
Stop sprites from moving for a few seconds.
You should just be able to use a variable to keep track of the hammer state and then in the forever loop controlling movement wait until the variable is 0. If this is where you're using the ‘hammer’ broadcast instead try setting a variable to 1 and waiting your set time before setting it back to 0. The mouse sprites can then only move when hammer=0.
- mstone326
-
1000+ posts
Stop sprites from moving for a few seconds.
Problem is inside the forever loop are a bunch of repeat until blocks. So when the loop variable changes, it doesn't trigger until the repeat until block has completed. I thought of stopping t he script but ended up putting an if pause = no inside each of the repeat until blocks.
- Swampat
-
25 posts
Stop sprites from moving for a few seconds.
Thank you Problem is inside the forever loop are a bunch of repeat until blocks. So when the loop variable changes, it doesn't trigger until the repeat until block has completed. I thought of stopping t he script but ended up putting an if pause = no inside each of the repeat until blocks.
- coolmascateergirl
-
1 post
Stop sprites from moving for a few seconds.
how do I make my sprit to stop moving without it touching something?
- ScratchCatHELLO
-
1000+ posts
Stop sprites from moving for a few seconds.
Post this in your own topic. how do I make my sprit to stop moving without it touching something?
- crackerman1-10
-
72 posts
Stop sprites from moving for a few seconds.
I want to learn that too. how do I make my sprit to stop moving without it touching something?
- Deyjonnay
-
1 post
Stop sprites from moving for a few seconds.
how do I make my sprit to stop moving without it touching something?
Im trying to figure this out too. Anyone?
- hwlauf
-
100+ posts
Stop sprites from moving for a few seconds.
what do you mean? do you mean in a platformer? how do I make my sprit to stop moving without it touching something?
- amazingscratchcoder
-
100+ posts
Stop sprites from moving for a few seconds.
Please make your own topic. Reported
- Discussion Forums
- » Help with Scripts
-
» Stop sprites from moving for a few seconds.