Timer in CoBlocks


#1

Maybe I’m wrong, but it seems like making a variable in Scratch is SO much easier than in CoBlocks. Could someone please share a script with me of a countdown in CoBlocks? We want to see it, and when it reaches 0, it triggers something else (like a new level). Thanks for all that you do!


#2

Hi @Kelly_Nickell!

Below you can find a simple timer example :slight_smile: . Press the remix button to copy the space and check out the code.


#3

Thanks Stefan,

I am super impressed that the CoSpaces team gets back to me so quickly whenever I have a question.


#4

Imagine that we want to find three objects. We have 15 seconds to do it but we got the three objects before the timer ends. what can we do to stop the timer?

Thanks so much


#5

Hi @Bcodesal,

do stop the timer when all three items are found, you can use the break out of loop - block like this. Breaking out of the loop will stop the forever - block and the countdown :slight_smile:.

Click to see code solution

I noticed that your code can be improved by functions, too! I’ve send you a PM to show how your space can be improved.