Time bomb danger !!

Game Editor comments and discussion.

Time bomb danger !!

Postby sonicforvergame » Tue Feb 26, 2013 9:28 am

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 ????
Kaizoku ni ore wa naru
User avatar
sonicforvergame
 
Posts: 422
Joined: Sat Sep 01, 2012 2:17 pm
Score: 10 Give a positive score

Re: Time bomb danger !!

Postby MrJolteon » Tue Feb 26, 2013 10:07 am

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.)
Join us on Discord!
Game Editor 2
These are the best ways to reach me these days


Your local Community Janitor, always lurking in the shadows...
User avatar
MrJolteon
 
Posts: 2326
Joined: Sat Aug 09, 2008 3:25 pm
Location: Stranded under endless sky
Score: 105 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest