How do I make a timer that count down and then count up

0 favourites
  • 4 posts
From the Asset Store
An educational game for counting pictures. An easy to use template for developers to build larger games
  • Hello

    i'm doing a game with a timer that must start from 60 to 0 and then count up now i have.

    es.tinypic.com/r/2h6zsp3/9

    that do the first part of going from 60 to 0 but how i do the other half?.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I think you need a switch boolean.

    1)Create a Global Number Variable called Switch with a value of 0. And also Create your Global Number Variable called Timer with a value of 60.

    2) Apply this event:

    *Timer <= 0

    ----> Set Global Number Variable (Switch) to 1.

    *Switch = 0

    ----->Subtract from Timer (dt)

    *Switch = 1

    ------>Add from Timer (dt)

    3) Tip: It's a good practice to add this event for accuracy:

    *Timer < 0

    -----> Set Timer to 0

  • Actually,

    Var Timer = 60

    Var Switch = 0

    Every 1 Second

    If Switch = 0

    Substract ...

    If Switch = 1

    Add ...

    if Timer = 0 or if Timer = 60

    Set Switch to abs(Switch - 1)

    -- Sub-Event of Event

    This way. it will also switch from 60 to 0 to 60 accordingly, And will also substract or add before chaning switch and thus you won't need your good practice event

  • Actually,

    Var Timer = 60

    Var Switch = 0

    Every 1 Second

    > If Switch = 0

    > Substract ...

    > If Switch = 1

    > Add ...

    > if Timer = 0 or if Timer = 60

    > Set Switch to abs(Switch - 1)

    > -- Sub-Event of Event

    This way. it will also switch from 60 to 0 to 60 accordingly, And will also substract or add before chaning switch and thus you won't need your good practice event

    TY a lot it works perfectly as i want =)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)