how to make a simple timer?

error123error123 Member Posts: 112
edited November -1 in Tech Support
i need to add a timer to one of my apps. which times how long its taken you to get to the last level. so every scene needs to keep the time going from the previous scene.

There will need to be a time limit also so if you don't reach a certain time then you will loose the game.

Also if i cant make this work on my own then i would like to send the project files to someone who knows what they are doing. thanks

Comments

  • forkliftforklift Member Posts: 386
    To have a timer running for how long the game is played:
    Game attribute (integer) = Timer
    Rule in Timer: Every 1 second [change attribute game.timer] to [game.timer+1]

    To have a timer counting down:
    Game attribute (integer) = CountdownTimer
    Rule in CountdownTimer: Every 1 second [change attribute game.countdowntimer] to [game.countdowntimer-1]

    If game.countdowntimer = 0 [change scene to gameoverscene]
  • error123error123 Member Posts: 112
    Thank you forklift, do i have to create a new actor for all this?

    ill try this out tomorrow and let you know if i can get it to work.
  • forkliftforklift Member Posts: 386
    This will most likely need to be an instance.

    Meaning:
    1. Make an actor to place your timer rules into.

    2. Drag that actor into the game scene just off the edge of the game area.

    3. Double click the actor inside the game area and place the rules inside this 'instance' instead of opening it and adding rules the normal way (from the actor selecting menu ((above the rules and image tabs)).

    4. Make sure the instance's movement checkbox is unchecked.
  • error123error123 Member Posts: 112
    how do i find (integer) ?

    forklift could you post an image of what it would all have to look like in the actor so all the rules and stuff so i can just copy it? thanks
  • error123error123 Member Posts: 112
    ok i made a timer but it keeps flickering? like flashing each tick

    also once the scene changes the time is gone. how do i continue the time counting on each scene and so that you can see it
  • error123error123 Member Posts: 112
    ok i can make the countdown but it it flickers as it counts down each number? anyone know why?
  • error123error123 Member Posts: 112
    come on someone help must be a reason for this
Sign In or Register to comment.