Is there a way to add a time variable into a game.

Home Forums Monkey 2 Programming Help Is there a way to add a time variable into a game.

Tagged: 

This topic contains 2 replies, has 2 voices, and was last updated by  QueCumber 2 months, 2 weeks ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #10369

    QueCumber
    Participant

    For a programming project at school i am looking to make a western duel game where you must test your reaction time against an opponent. I was wonder if i can add a time variable to the game, in which i can record the reaction time of the user and also set the reaction time of the opponent?

    #10373

    abakobo
    Participant

    You have the Millisecs() function for that

    Here’s a little example, don’t know if it’s accurate enough for you. I assume OnKeyEvent should be more accurate than OnUpdate (I suppose putting it in OnRender with “If Keyboard.KeyDown(Key.Space)” is a bad idea as it is called more or less at 60 fps)

    [/crayon]
    #10375

    QueCumber
    Participant

    Thank you for the help! Much appreciated!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.