Create wait variable and code wait
Often on a real terminal in a shop, you will see a young child quickly press the buttons. At the moment in your code if this happens your counts will go up very fast, how can we prevent recording all these extra clicks?
One way would be to only record a click after a certain number of seconds from the previous click, say 5 seconds. This would mean that even if someone pressed a button several times, it would only record one.
Create a variable called 'wait' and change your code to the following. This code does the following:
- it checks if 'wait' is 0
- if it is it records the click and set wait to 5
- it count downs wait to 0
when this sprite clicked
if < (wait) = (0) > then
change [very happy v] by (1)
set [wait v] to (5)
repeat until < (wait) < (1) >
wait (1) seconds
change [wait v] by (1)