Hi, I’m pretty new to Thunkable and a little bit confused as to why the timer stops working when a sprite of “sprite type 1” is clicked for the first time?
The way I see it, everytime a sprite of “sprite type 1” is clicked, the timer should start from ten and a certain number of sprites should be relocated (or newly created). But as I can tell from testing the app, all works perfectly fine until a sprite of “sprite type 1” is clicked. Afterwards only the score goes up when ever such a sprite is clicked.
Furthermore, the app doesn’t always act the same when started. Sometimes no sprites appear at all.
The only reason I can think of as to why this is, is that they are too many blocks in “game”, but I’m not totally sure, why I hope to get some help from you.
Do you see any mistakes in the script?
There are some more blocks only concerning the sprites’ speed, which I cannot post due to the limitation of pictures.
The game is supposed to be similiar to this one minigame from “Super Mario 64 DS” called “Wanted!”.
I am not exactly sure what you want to achieve but to me one issue seems to be that I cannot find any event that starts the timer and also no event when the timer fires in your blocks.
you set a variable to 10 but I cannot see any block related to the timer component.. Or am I getting you wrong that you want to start a timer that fires an event after a certain period of time once a sprite is touched?
You mean filling the gap in the violet block?
My only intent is to creat a sprite and I don’t really know what the gap is used for. When created the sprites only purpose is to exist.
The game is supposed end once the timer reaches zero. Did you see the blocks in the second picture at the top? There it should tell the app to count down to zero.
Ok, I see what you mean. I’m referring to the variable called timer, which I intended to programm a timer with. Shouldn’t a variable that is changed every second by -1 work as well?
My two main problems are that the timer stops when a sprite of “sprite type 1” is clicked and that the script inside the “when Sprite_Type1 is clicked” only appears to work the first time.
Yes, that would work too but I also cannot find any block that causes a 1 second delay. Therefor my guess is that whenever you press a Sprite your variable might be reduced by -1 but it will not work as expected.
Your code, which I’ve sketched below, should subtract one from the variable value every second until the condition is false. So, no, it shouldn’t only be activated after the loop ended. It should be activated within the loop.
Repeat while [condition]
_____do
__________wait 1 seconds
_______________change variable