Discuss Scratch

CheekyMonga
Scratcher
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?
Onnk4967
Scratcher
84 posts

how to restart a timer variable

On the monster scribble sprite it says if timer is 3 then next costume
CheekyMonga
Scratcher
32 posts

how to restart a timer variable

i

Onnk4967 wrote:

On the monster scribble sprite it says if timer is 3 then next costume
i know. when the timer equals 3 it should do that not so scary jumpscare
HurricaneSlicer96
Scratcher
11 posts

how to restart a timer variable

What does it do weird?

Last edited by HurricaneSlicer96 (Aug. 18, 2020 20:45:12)

CheekyMonga
Scratcher
32 posts

how to restart a timer variable

HurricaneSlicer96 wrote:

What does it do weird?
the timer for some reason goes faster than it is supposed to or sometime it skips seconds.
FateSealer
Scratcher
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.

Powered by DjangoBB