Good afternoon,
I'm working on a game that is time and score dependent, i.e. you have thirty seconds for the whole game. What your score is by the end of the game depends on if you win or if you lose, but whenever I put in a conditional command ("if score=30 and timer<30") it doesn't work. Even my stop all script commands ("when timer = 30" stop all) do not seem to be going through. Any advice? I'm very new to Scratch and need this for a homework assignment. Thanks!
Offline
awnothecorn wrote:
Good afternoon,
I'm working on a game that is time and score dependent, i.e. you have thirty seconds for the whole game. What your score is by the end of the game depends on if you win or if you lose, but whenever I put in a conditional command ("if score=30 and timer<30") it doesn't work. Even my stop all script commands ("when timer = 30" stop all) do not seem to be going through. Any advice? I'm very new to Scratch and need this for a homework assignment. Thanks!
Use when timer > 30 stop all, since timers never equal an exact number.
Offline
awnothecorn wrote:
Good afternoon,
I'm working on a game that is time and score dependent, i.e. you have thirty seconds for the whole game. What your score is by the end of the game depends on if you win or if you lose, but whenever I put in a conditional command ("if score=30 and timer<30") it doesn't work. Even my stop all script commands ("when timer = 30" stop all) do not seem to be going through. Any advice? I'm very new to Scratch and need this for a homework assignment. Thanks!
aha, if the timer is running for the whole game you need a "forever" block before the condition otherwise without the forever if you wanted the timer to start when the green flag was pressed it would check if the timer = 30 when the green flag is pressed and then the script will stop.
Ah, i have just written all that ^ and realised i might not be answering the right problem, does it help or am i going down the wrong track?
EDIT- outposed by Molybdenum
Last edited by Willpower (2012-11-03 13:37:51)
Offline
Answer:
When green flag clicked Reset timer Wait until <<(timer) = [30]> or <(timer) > [30]>> Stop all
Offline