Page 1 of 1

Time bomb danger !!

PostPosted: Tue Feb 26, 2013 9:28 am
by sonicforvergame
Well here is what i can't figure out
you have a specified time to finish a song (i am making a tap tap game and don't mind if you don't know what it is)
AND it's a digital clock so you can see how much time you have left
AND i want that every second one second of the clock go away
MEANING 1second really life=-1 second of game time
AND when the clock point O:OO

GAME OVER

So how do i do that ????

Re: Time bomb danger !!

PostPosted: Tue Feb 26, 2013 10:07 am
by MrJolteon
sonicforvergame wrote:Well here is what i can't figure out
you have a specified time to finish a song (i am making a tap tap game and don't mind if you don't know what it is)
AND it's a digital clock so you can see how much time you have left
AND i want that every second one second of the clock go away
MEANING 1second really life=-1 second of game time
AND when the clock point O:OO

GAME OVER

So how do i do that ????

With variables and timers.
First, create a timer set to 100 ms.
Then, do this in a Timer event:
Code: Select all
secondVariable--;

If you want it to also show minutes, do this:
Code: Select all
if(secondVariable==0)
{
    secondVariable=59;
    minuteVariable--;
}

To check if the time is 0:00, do this:
Code: Select all
if(minuteVariable == 0 && secondVariable == 0)
{
    //Game over code here.
}

(There might be a better way to do this, though.)