Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[Tutorial & Coding] Recording Play Time

Ok well I'm 10000000% sure this has been done already, and is very basic common knowledge, but I had to code it for part of my game and decided I might aswel release it as it may help others, it can't hurt to do that.
It's a good example for beginners learning how to use variables.

This coding is designed to keep a record of how long the player has played for. It also runs error checks to see if the seconds or minutes variables are above 60, and corrects them if they are.
This coding uses conditional branches within, conditional branches, so it doesn't have to constantly check several variables every time a second is counted.
This script uses Labels which can be used to jump to a certain part of coding in a single event. They are used to run a specific part of coding without the whole event being processed, and so can reduce lag in games.
This coding doesn't really require Labels, but if you don't know much about them, this will give you a basic idea.

Enjoy.

http://rapidshare.com/files/60239789/Recording_Play_Time.zip.html
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top