Jump to content


Photo

Using Time Elapsed, Create High Score Table (help)


  • Please log in to reply
8 replies to this topic

#1 heartfang

heartfang

    GMC Member

  • New Member
  • 11 posts

Posted 15 February 2010 - 11:24 PM

Heya,

Im trying to figure out how to have a timer in HH:MM:SS be displayed on the screen and have it run through all rooms of the game. When all levels are completed, I would like to have a high score table with the lowest time going to the highest time.

I have Pro and would prefer drop down, but if it needs to be in code, thats fine.

Thanks a bunch!

Edited by heartfang, 15 February 2010 - 11:41 PM.

  • 0

#2 heartfang

heartfang

    GMC Member

  • New Member
  • 11 posts

Posted 15 February 2010 - 11:48 PM

anyone know?
  • 0

#3 Kolink

Kolink

    Almighty Shinx

  • GMC Member
  • 2351 posts

Posted 15 February 2010 - 11:51 PM

Damn, these 48-hours are getting real fast! I'll be old soon!

Just save the time they started, and get the time they finish, take the difference and bingo.
  • 0

#4 heartfang

heartfang

    GMC Member

  • New Member
  • 11 posts

Posted 15 February 2010 - 11:58 PM

u mean use it as a negative number? that seems like it would be a bit stupid looking

also, if possible, id like to have the time displayed.
  • 0

#5 Kolink

Kolink

    Almighty Shinx

  • GMC Member
  • 2351 posts

Posted 15 February 2010 - 11:59 PM

"Difference between them" means the gap between the two times, ie. the absolute value, ie. the bigger minus the smaller, ie. the end time minus the start time.

To display it, just get the current time, minus the start time, and display it.

PS. Don't call me stupid.
  • 0

#6 heyufool1

heyufool1

    Fail

  • GMC Member
  • 1651 posts
  • Version:GM8

Posted 16 February 2010 - 12:13 AM

time:
seconds += 1 / room_speed;
if (seconds >= 60)
{
	 seconds = 0;
	 minutes += 1;
}

if (minutes >= 60)
{
	 minutes = 0;
	 hours += 1;
}

game start event:
beginSeconds = seconds;
beginMinutes = minutes;
beginHours = hours;

when you find the highscores:
highSeconds = abs (seconds - beginSeconds);
highMinutes = abs (minutes - beginMinutes);
highHours = abs (hours - beginHours);

Edited by heyufool1, 16 February 2010 - 12:14 AM.

  • 0

#7 heartfang

heartfang

    GMC Member

  • New Member
  • 11 posts

Posted 16 February 2010 - 12:17 AM

i appologize for the miss worded response, im tired. when i said stupid, i meant something like unwieldy or clumsy.

once again, im extremely sorry if that looked like i was calling u stupid, i cant figure it out so there is no way i would intentionally call someone who can, unintelligent




anyway on the score board though, wouldnt the high score rank them from high to low?

for getting the start time do i set up a DD menu option where it sets a variable (lets call it start) to current_time? then when i want to set the score i do something like current_time-start, but how do i get it do update as time passes? right now ive got it only showing the initial start time and later when done, the end time but it doesnt update as the game goes on. also, how to i transfer this to HH:MM:SS and get the high score to read it?
  • 0

#8 Kolink

Kolink

    Almighty Shinx

  • GMC Member
  • 2351 posts

Posted 16 February 2010 - 12:18 AM

You can't easily use the default highscore table with this - you have to make your own.
  • 0

#9 heartfang

heartfang

    GMC Member

  • New Member
  • 11 posts

Posted 16 February 2010 - 05:56 AM

hmm, thats a good point.


okay, ill scrap the idea of having a stopwatch function, instead, ill set a countdown clock
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users