alarm and score



I'm working on a game for a schoolproject and I need to make an alarm. This alarm has to work in different rooms, but it has to be the same countdown alarm. When the alarm ends, the game needs to stop.
The score has to be a global score which we can display in different rooms. After the game ends (so the alarm has counted down to 0), the score will be shown.

Any tips? Our previous attempts didn't work out.


so i have succeeded at creating a countdown alarm and a score, but the score won't up. When my avatar collides with a certain object we use the code global.score += 1 and in the score object we put global.score = 0. But then, when we draw the score, it stays 0.

When the countdown is at zero the game is supposed to go to the endroom, but it doesn't. We used a check alarm function and then we put the go to room function after that. Why doesn't it work?


My pet squirrel didn't come for its peanuts today. Why didn't that happen?
More specific please! ;)
From what I understand though, you are setting your global.score to 0 and them wonder why it is 0?


Yes i set my global.score to 0, but then whenever the avatar collides with the certain object, the global.score is supposed to up (global.score += 1).

Then for the alarm we have used a step event in which we put the actions "if alarm 0 is equal to", of which the time is 180, so it's supposed to count from 180 to 0, which it does, but then it doesn't stop counting down at 0.
After that action we put a "go to room", with the room it's supposed to go to.


Forum Staff
Please post all relevant code, structured and ordered by the object and event it is in. Puzzling together potential code from a description is both inefficient and error-prone, thus reducing our chances of being able to help you and your chances of getting this resolved.

For further information: How to Q&A