How do I reset the time?

  • So here's my issue, I have a game in which an event occurs every ten seconds and when the player dies it resets the layout. Now the every ten seconds is related to a variable (distance) and I need them to line up. Evidently resetting all global variables does not include the system expression time. So how do I reset the time so that every ten seconds is based of the start of the layout being 0?

    TLDR; I need my every 10 seconds event to be based off the the beginning of the layout.

  • Bump

  • hello

    one way around it is to do every 0.01 seconds + 0.016666 to a global variable

    then in divide it by ten for the no. of ten seconds.

    on "player" destroy reset global variables

    cons : the decimal values showing up.

           there is a minor miscalculations of 0.1 seconds

           it is a sort of cheating

  • How do I reset the time?

    With quantum physic.

    Or a counter.

    Make a global variable "TimeCount", set it to 0.

    Add an event:

    "TimeCount" >= 0 => action Add dt to "TimeCount".

    Add another event:

    "TimeCount" >= 10 => action Set "TimeCount" to 0 + anything else you want to happen after 10 seconds

    .

    This allows you to "reset time" by setting the value of "TimeCount" to 0.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • > How do I reset the time?

    With quantum physic.

    Or a counter.

    Make a global variable "TimeCount", set it to 0.

    Add an event:

    "TimeCount" >= 0 => action Add dt to "TimeCount".

    Add another event:

    "TimeCount" >= 10 => action Set "TimeCount" to 0 + anything else you want to happen after 10 seconds

    .

    This allows you to "reset time" by setting the value of "TimeCount" to 0.

    Thanks, worked great!

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