Time based game

Hello, I am building my first game and I want to be time based instead of score based.  For example I want the high scores to be based on how long it takes you to finish a level.  If anyone could point me towards a tutorial on how to do this that would be great!  I tried searching the forums, but couldn’t find what i was looking for.

Use system.getTimer() at the start of the level and once again at the end of the level. The difference between these is the time spent doing the level in milliseconds.

I think your 1st point to think about is how you plan to handle time in your app - will it be displayed on screen or just at end of level.

Also won’t i t be a case of high score = low time.

There have been some tutorials relating to time in the corona blog which may be helpful.

T.

I want it to be on screen.  Could you link me to one?  I’m having trouble finding anything.

The blog post: http://coronalabs.com/blog/2013/01/15/working-with-time-and-dates-in-corona/

google “corona sdk blog time score”

I find using “corona sdk” and then whatever is a great way to search for stuff - you can add “forum” “blog” “tutorial” etc… to refine results.

T.

Sounds to me like you could just create a text object and have it display the time counting down, no? What exactly are you struggling with? Calcuting the time the right way or displaying it on screen?

Use system.getTimer() at the start of the level and once again at the end of the level. The difference between these is the time spent doing the level in milliseconds.

I think your 1st point to think about is how you plan to handle time in your app - will it be displayed on screen or just at end of level.

Also won’t i t be a case of high score = low time.

There have been some tutorials relating to time in the corona blog which may be helpful.

T.

I want it to be on screen.  Could you link me to one?  I’m having trouble finding anything.

The blog post: http://coronalabs.com/blog/2013/01/15/working-with-time-and-dates-in-corona/

google “corona sdk blog time score”

I find using “corona sdk” and then whatever is a great way to search for stuff - you can add “forum” “blog” “tutorial” etc… to refine results.

T.

Sounds to me like you could just create a text object and have it display the time counting down, no? What exactly are you struggling with? Calcuting the time the right way or displaying it on screen?