How do I use a timer (or a better solution)?

  • Hi,

    First a little of context. I'm creating a puzzle game (something similar to Tetris) and I'm having some problems with the conditions to trigger the "Game over".

    Here is what I'm trying to achieve:

    There is a layout with 5 columns of pieces, any of them have an invisible trigger to change the boolean variable to active.

    overlapping_1

    overlapping_2

    overlapping_3

    overlapping_4

    overlapping_5

    My idea is:

    When the five booleans are active, start a timer, and after 2 seconds (if the five booleans are still active) stop the game and show "Game over" text.

    I created an object with Timer behavior, but the problem is when all booleans are true the Timer not triggered (It seems active but when "finish" nothing happen)

    Any recommendation? Maybe exist a simple way to achieve this without use a Timer or maybe I'm doing something wrong πŸ˜…

    Thank you for your help! πŸ™πŸ»πŸ˜Œ

    Tell me if you need more information πŸ˜‰

    Alberto.

  • You're starting the timer over and over again, you are saying when all booleans are true, keep running the timer every tick. You need a system > trigger once while true in a condition with the boolean checks.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I think I might know what's going on here, ran into a similar issue using timers. Check the debug window to see if the timer ever starts counting down. If it's not, your issue is that when all your booleans are active, the timer is continually restarting since every tick the condition is still true and triggering the timer all over again, so it can never reach zero and trigger the Game Over.

    Throw a System > Trigger Once as a sub-event for the timer, and you should be all set.

  • You're starting the timer over and over again, you are saying when all booleans are true, keep running the timer every tick. You need a system > trigger once while true in a condition with the boolean checks.

    Damn, you beat me to it xD

  • > You're starting the timer over and over again, you are saying when all booleans are true, keep running the timer every tick. You need a system > trigger once while true in a condition with the boolean checks.

    Damn, you beat me to it xD

    At least we know it's definitely resolved :)

  • plinkie and tommyoliversays!

    Many thanks for the response! so simple that I couldn't find it.... πŸ˜…

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