spaceinvadersThis is a simple example-game that shows how to use online highscore lists in PHP, MySQL and GLBasic. The client don’t need anything except windows or linux possibly. For the server you need a halfway new PHP version and MySQL for it to work. You also need to download CodeIgniter because I use the database commands from that library for easy access.

The client calls a homepage with the path

"http://your.homepage.com/index.php/listgame/highscore/game_name/playername/score/64byte_hash"

The 64byte_hash is created from all the other data so if those don’t add up when the server gets it all, it won’t be added. This should be resonably safe until someone REALY wants to hack your highscore table. To get the list of highscores just call the same routine (Highscores) with an empty name and score and you will download an ini-file that the scores will be loaded from and shown to you.

Download source

Last updated 2008-10-27

This code is intended for GL Basic.

Leave a Reply