countdown timer help please

supertedsuperted Member Posts: 20
edited November -1 in Working with GS (Mac)
hi all , im trying to add a countdown timer to a scrolling level so that you run out of fuel before the level stops scrolling and a life is lost , does anyone have any idea how this would work ? . any help would be gratefully recived

S

Comments

  • HadiDaManHadiDaMan Member Posts: 115
    Go on youtube and type in gamesalad timer tshirtbooth and click the first one.

    :]
  • supertedsuperted Member Posts: 20
    thanks but i still dont really see a tut to help or im being thick? , i see the score and displaying timer tut , but i still can not figure out how to make this work , it does not matter if it counts up or down as it does not need to be displayed really , in my head it goes something like this " run timer , when timer is equal or same as XXX then -1 life , level restart , if life = 0 then goto game over !!
  • entersimonentersimon Member, PRO Posts: 273
    You achieve this with attributes.

    Make an attribute called timer and make it an integer with the value you want as your max seconds (we'll be counting down).

    Make an attribute called lives and make it an integer and give it the max number of lives you want.

    For this example i'll use 10 seconds and 3 lives.

    Then in an actor of your choice (I like using a single actor as a controller for attributes) make your timer:

    We'll assume you want the timer to stop when all lives are lost.

    Make a Rule that says if attribute (lives) > 0
    Timer
    every 1 second
    Change attribute (timer) to (timer)-1

    Then another rule that says if attribute (timer) < 0
    change attribute (timer) to 10

    Then make another rule that says if attribute (timer) = 0
    change attribute (lives) to (lives)-1

    Now you have your timer and your lives counting down appropriately and stopping when you're out of lives.
  • supertedsuperted Member Posts: 20
    thank you very much , i will give that a go when i get a chance .

    S
Sign In or Register to comment.