Reset gametime and gamecounter to zero

Yet, again I am asking for assistance. Thanks for any help you can offer. I have a game that I am building. Two conditions are that if the clock(game time) runs to 40 seconds than you lose and if one actor(captain america) collides with another(a fan), you lose. The objective is that if you click on the 'restart game' icon, than the clock will reset to zero, the game score will also reset to zero. and you will go back the initial scene. Fortunately the scene does change back to the initial scene. Unfortunately, the 'clock' does not reset to zero rather continues from the place/time it was when the scene was changed back to initial scene and the score also does not reset to zero.

I have tried unsuccessfully to 'change attribute' to zero for game time and gamescore and reset game.

Hope someone can help.

Thanks!!!

Best Answer

  • anatomyofdreamsanatomyofdreams Posts: 723
    edited December 2012 Accepted Answer
    Im not entirely sure that this will be helpful but thought id help wherever i could. I dont have experience using the devices game time, but i do have plenty of experience using the behavior TIMER. All i can say is, IF you use TIMER then im not sure why there would be any problems. For me this is what ive done to ensure the timer goes back to 0. First i put a rule in a static actor (off screen) that says change attribute TIME (an integer or real attribute ive created) to zero. This ensures on game start the time count goes to zero. Then i also put a rule in the reset game button that says, when button pressed change time attribute to zero and then go to scene x. So these are two instances of resetting the time to zero.
    As for the timer, the rule is simple. Theres a TIMER attribute used that says every 1 second, +1 from TIME (the attribute i mentioned above a few sentences ago). When TIME reaches x do x. So as you can see im not using a game time here, im using a TIMER. Everything ive mentioned here should guarantee work. Whether or not thats a way you want to do it is up to you. Good luck :)

Answers

  • PaxPaxPaxPax Member Posts: 106
    Thanks Anatomy----, I will grab another coffee and give it a go.
  • PaxPaxPaxPax Member Posts: 106
    Thanks again Anatomy...it worked and makes things much simpler!!!
Sign In or Register to comment.