Implementing a time-based scoring system

0 favourites
  • 9 posts
From the Asset Store
An educational game for Times Table. An easy to use template for developers to build larger games
  • Hi, I'm looking to implement a time-based scoring system for a project of mine. As such, once the player starts a level, a timer starts counting from 0 in the "00:00:00" (mm: ss: milliseconds) format. Once the player completes a level, this timer get's stopped.

    Can someone guide me on how I can implement this type of a system?

  • There is a timer behaviour, but you can also do it like this for a simple timer:

    You can download the example capx here: file.io/J2KMD9Rbrohq

    This is just 1 way of doing it, there are many ways you can do it.

    At the end of the game all you want to do is save the minutes&sec variable to an array/leaderboard/etc

    Edit: i noticed you wanted MS aswell, all you gotta do is add a ms variable and do it the same way i did above.

  • Thanks for the response, greatly appreciate it :)

    Just had the opportunity to try it out. I included the milliseconds part as you suggested. Though most of it seems to be working fine, I find the timing to be a little slow. Can you guide me on how I can fix this? Following is a screenshot of my events for your reference.

  • I think I fixed it sort of. Rather than keeping MSPassed ≥ 99, I set it to 60. if you believe there is a better way I can incorporate this, I would love to hear it from you. Thanks once again for your support.

  • Sami424, sorry to bother you again. I'm facing another issue. As such, I would like to set up the game in such a way where, once the player completes a level, I would like the timer to stop to that point and then display this time on a menu. Any thoughts on how I can do this? you mentioned earlier that this can be achieved with the help of saving the minutes&sec variable to an array. Apologies, as someone who is just getting started in game development, I have no clue how to do this. hope you would be able to help me with this. Thanks for your time.

  • Create a Global Boolean: TimerActive = True

    Add the Event is TimerActive = True as part of the Every 0.001seconds event

    (this should have no effect of the game)

    Whenever the player finish the game then set an action: TimerActive = False

    This will stop your timer from ticking.

    You can then do what you need with the numbers you have stored in MSPassed, SecPassed, and MinutesPassed

  • Just tried it out, It doesn't seem to work :(

    Not too sure what I'm doing wrong. Following is a screenshot of my events. Please note that I have set up events in such a way where, when the player object collides with a particular object/ sprite, it loads to the next level. hope you would be able to guide me on this.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • This should help :)

  • Works like a charm!! :D

    thanks a lot.

    you are a lifesaver :)

    I'm just trying to wrap my brain around how exactly the logic behind this is working. The way it works feels like magic to me!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)