Trouble with creating a Game Timer

Hello!

I am trying to figure out how to implement a timer in which the player has a limited time to play the trivia game and if they don't complete it within the given time frame, the game is over.

I have a timer actor where every one second the game attribute (integer) game.Timer changes to game.Timer-1

I have a rule set to when the game.Timer attribute = (0) it changes the scene to Game Over

Any help for this? Or can I get an email to send a copy of the game to?

Comments

  • adent42adent42 Key Master, Head Chef, Executive Chef, Member, PRO Posts: 3,159

    So the two things I'd look at are:

    Use game.time which is the the time in seconds. Create an attribute like game.EndTime set it to game.time + your time limit.

    Then your rule check checks if game.Time < game.EndTime . I can display time left by showing game.EndTime - game.time.

    This works if you care only about when the game is active (i.e. backgrounding the app stops the timer).

    If you want to go by absolute time, use the device.clock instead.

    Hope that helps.

  • MikaylaPuentesMikaylaPuentes Member, PRO Posts: 6

    Sorry, no. It didn't help much

  • adent42adent42 Key Master, Head Chef, Executive Chef, Member, PRO Posts: 3,159

    If you have a sample project, publish it. Then DM me the publishing portfolio link so I can take a look.

    If you want faster help, do the same, but write in to our Customer Success team (the blue chat bubble on the main site).

Sign In or Register to comment.