How do I reset system time? or...

0 favourites
  • 7 posts
From the Asset Store
An educational game for Times Table. An easy to use template for developers to build larger games
  • Hello, I have "every x seconds" events with "compare time"

    Event: Action

    System/time <= 10.0 second create object "sprite"

    every 3.0 second/

    I want to create and spam objects until the second 10 after the game was started, but in "on start of layout", the time continues, so the objects will not be generated, due to the condition that it only needs to be created until the second 10 of having started the game.

    Thanks.

  • Create a variable "StartTime", set it to "time" on start of the layout.

    Then change your event to this:

    System-> Compare two values -> (time-StartTime)<=10

  • Create a variable "StartTime", set it to "time" on start of the layout.

    Then change your event to this:

    System-> Compare two values -> (time-StartTime)<=10

    Its works, thanks you very much.

    But I do not understand what is happening.

    At the start of the game, the StartTime variable is being initialized together with the system time?

    how did StartTime get the restart, without setting StartTime in 0 again?

  • Did you put "Set StartTime to time" at the "On Start of layout"?

    Then yes, it will be very close to 0 when you launch the game. (because "time" starts from 0)

    Every time this layout is restarted, StartTime will be updated to current time.

  • Did you put "Set StartTime to time" at the "On Start of layout"?

    Then yes, it will be very close to 0 when you launch the game. (because "time" starts from 0)

    Every time this layout is restarted, StartTime will be updated to current time.

    It works, but this "time" its different from system time?

    Because the system time starts and does not stop. When the application starts it does not return to 0

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Correct, "time" is different from the system time.

    "time" starts from 0 when the application starts.

  • Correct, "time" is different from the system time.

    "time" starts from 0 when the application starts.

    Ok thanks you very much, now i learned how to implement events with time.Thanks!

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