Timer when 0, inverse controls

0 favourites
  • 7 posts
From the Asset Store
Tabata timer
$9.99 USD
Template for Tabata timer, fully documented in comments and video
  • Hi,

    im trying to create a game, where the player has 60 seconds to complete the layout. If the timer gets to 0 i want that the controls get inverted, therefore right is left and left is right.

    I create a global variable of 60, created a tick event where every tick, 1 second is decreased. But im stuck now

    can someone help me out? Thanks in advance !

  • you need variables:

    timer = number (counts down from 60)

    inverse = boolean

    events:

    every tick: add to timer -1
    system compare variable:
        timer <= 0:
            toggle inverse
            set timer to 60
    
    keyboard events:
    A is down:
        compare boolean set: inverse
            move player -2
        else: (to add an else press x)
            move player 2
    
    same with D (or Arrow keys)
    
    [/code:31phqpyb]
  • Hi,

    im trying to create a game, where the player has 60 seconds to complete the layout. If the timer gets to 0 i want that the controls get inverted, therefore right is left and left is right.

    I create a global variable of 60, created a tick event where every tick, 1 second is decreased. But im stuck now

    can someone help me out? Thanks in advance !

    hi, disable movement behavior "default controls" then add a timer behavior (with regular option) and code something like this (i used 5 seconds for quick test, you put 60 seconds ^^)

  • Hey mate, this worked out! Thanks i appricate it.

    Just 1 last thing. How would i show that timer in a text?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hey mate, this worked out! Thanks i appricate it.

    Just 1 last thing. How would i show that timer in a text?

    for example you can add a Text object, type "60" into text field properties, then add code something like this

  • There are various ways of doing it. Either use a 1 second timer, or you can use this:

    ceil(Player.Timer.Duration("60seconds")-Player.Timer.CurrentTime("60seconds"))

    to get the seconds countdown.

  • There are various ways of doing it. Either use a 1 second timer, or you can use this:

    ceil(Player.Timer.Duration("60seconds")-Player.Timer.CurrentTime("60seconds"))

    to get the seconds countdown.

    This worked. Thanks all, you helped me so much !

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