alarm and score

Discussion in 'Programming' started by infogirlzzz, Jan 21, 2019.

  1. infogirlzzz

    infogirlzzz Member

    Joined:
    Jan 21, 2019
    Posts:
    3
    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.
     
  2. PlayerOne

    PlayerOne Member

    Joined:
    Mar 14, 2018
    Posts:
    345
    If I'm reading this correctly you'd be better off using a countdown timer instead of an alarm event.

     
  3. infogirlzzz

    infogirlzzz Member

    Joined:
    Jan 21, 2019
    Posts:
    3
    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?
     
  4. Death

    Death Member

    Joined:
    Aug 8, 2018
    Posts:
    81
    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?
     
  5. infogirlzzz

    infogirlzzz Member

    Joined:
    Jan 21, 2019
    Posts:
    3
    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.
     
  6. TsukaYuriko

    TsukaYuriko Q&A Spawn Camper Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    1,621
    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
     
    PlayerOne and Death like this.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice