Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » how to restart a timer variable
- CheekyMonga
-
32 posts
how to restart a timer variable
this is what im trying to make: https://scratch.mit.edu/projects/417930664/editor
when you click the right arrow it is supposed to reset the timer but then it does something strange. any help?
when you click the right arrow it is supposed to reset the timer but then it does something strange. any help?
- Onnk4967
-
84 posts
how to restart a timer variable
On the monster scribble sprite it says if timer is 3 then next costume
- CheekyMonga
-
32 posts
how to restart a timer variable
i
i know. when the timer equals 3 it should do that not so scary jumpscare On the monster scribble sprite it says if timer is 3 then next costume
- HurricaneSlicer96
-
11 posts
how to restart a timer variable
What does it do weird?
Last edited by HurricaneSlicer96 (Aug. 18, 2020 20:45:12)
- CheekyMonga
-
32 posts
how to restart a timer variable
the timer for some reason goes faster than it is supposed to or sometime it skips seconds. What does it do weird?
- FateSealer
-
100+ posts
how to restart a timer variable
As you can see in your code of Sprite3 (the red head):
- your “game start” event block increases the value of the Timer
- your “message1” event block increases the value of the Timer too. Sprite4 broadcasts this event (when clicked), and Sprite3 receives it.
So, the value of the Timer gets increased by 1 second within two event blocks.
I also noted, that your Sprite4 and Sprite7 completely overlaps each other on the screen. This might cause problems.
Also, I saw, that you try to reset your Timer to zero in a forever loop. This might not be a good idea.
Finally, please, give your broadcast messages meaningful names instead of “message1” and “message2”. This would make troubleshooting much easier.
- your “game start” event block increases the value of the Timer
- your “message1” event block increases the value of the Timer too. Sprite4 broadcasts this event (when clicked), and Sprite3 receives it.
So, the value of the Timer gets increased by 1 second within two event blocks.
I also noted, that your Sprite4 and Sprite7 completely overlaps each other on the screen. This might cause problems.
Also, I saw, that you try to reset your Timer to zero in a forever loop. This might not be a good idea.
Finally, please, give your broadcast messages meaningful names instead of “message1” and “message2”. This would make troubleshooting much easier.
- Discussion Forums
- » Help with Scripts
-
» how to restart a timer variable