clock confusion. ($olved)
by rennie moffat · in Torque Game Builder · 09/20/2010 (4:16 pm) · 0 replies
Hi there,
I have a quick question.
I have a game where time is my score. Time runs up naturally, in seconds, minutes. If my time reaches 59 seconds it clicks over to 1 minute easily, however, if I hit an enemy ( by doing so, adds time ) I sometimes (if time is in the 59 second range when hit enemy) That instead of going to 1 minute as it should it (minute) is counted twice, once by the natural timer, to click over to one minute, but also the enemy, which has the power to effect the timer as well, also chimes in and must see that minute as at 1 minute and switches it up to 2 minutes. So what I am left with is a roll over that can sometimes if I collide with an enemy nearing 59 seconds (and any minute time) can sometimes double up, adding an extra minute.
I am wondering, would anyone have any suggestions as to how to negate that?
Currently, my timer is a behavior which simply sets the frame of the clock on a schedule, if at 59 seconds currentMinute is set to currentMinute + 1. The enemy, has a similar call, as if it collides with the playerClass, sets the timer as will in a similar fashion. It is in this I am sure I am sending two calls to set minute. Obviously, one is slightly behind the other, however, both see that seconds is around 59 so one sets minutes to currentMinutes + 1 equaling 1, then the other, just prior sees seconds equal to 59, and sends currentMinutes = currentMinutes + 1, tho currentMinutes is, now seen as == 1, so is set to = 2.
:::SSS
I have a quick question.
I have a game where time is my score. Time runs up naturally, in seconds, minutes. If my time reaches 59 seconds it clicks over to 1 minute easily, however, if I hit an enemy ( by doing so, adds time ) I sometimes (if time is in the 59 second range when hit enemy) That instead of going to 1 minute as it should it (minute) is counted twice, once by the natural timer, to click over to one minute, but also the enemy, which has the power to effect the timer as well, also chimes in and must see that minute as at 1 minute and switches it up to 2 minutes. So what I am left with is a roll over that can sometimes if I collide with an enemy nearing 59 seconds (and any minute time) can sometimes double up, adding an extra minute.
I am wondering, would anyone have any suggestions as to how to negate that?
Currently, my timer is a behavior which simply sets the frame of the clock on a schedule, if at 59 seconds currentMinute is set to currentMinute + 1. The enemy, has a similar call, as if it collides with the playerClass, sets the timer as will in a similar fashion. It is in this I am sure I am sending two calls to set minute. Obviously, one is slightly behind the other, however, both see that seconds is around 59 so one sets minutes to currentMinutes + 1 equaling 1, then the other, just prior sees seconds equal to 59, and sends currentMinutes = currentMinutes + 1, tho currentMinutes is, now seen as == 1, so is set to = 2.
:::SSS
About the author
My thanks to Garage Games and the Garage Games Community combined with owned determination I got one game up, Temple Racer and I am looking to build more interesting, fun games for the mass market of the iOS app store.