Made from simple PHP, MYSQL and lots of love.
How to use it
Code: Select all
highscore.init( "Game name" )
-- Place this into your load function.
-- "Game name" : A unique name for the highscore database.
highscore.add( "gamename", "name", score )
-- Adds a score to your highscore.
-- "Game name" : A unique name for the highscore database.
-- "name" : Name to add.
-- score : Score to add.
-- Returns true if added, false if there was an error.
highscore.get( "gamename", ascending )
-- Downloads the current highscores for your game.
-- "Game name" : A unique name for the highscore database.
-- Ascending: set to true if you want the scores in ascending order.
-- Returns a table of the highscores if you wish to draw them yourself.
-- The table is in the following format:
-- table[1].score = highest score.
-- table[1].name = name of the highest score.
-- table[n] ... and so on in decending order.
highscore.draw( x, y )
-- Put this in the draw function. This won't draw the highscores until you
-- call highscore.show(). When you do it will draw the highscore with previous and
-- next buttons and a close button.
-- x,y for position.
highscore.show()
-- Starts showing the highscores.
highscore.hide()
-- Hides the highscore.
highscore.fancyadd( "gamename", score, ascending )
-- Shows a box asking the player for their name. When they press
-- submit it will upload the score then download and show the highscore list.
-- "Game name" : A unique name for the highscore database.
-- Score: score to add.
-- Ascending: set to true if you want the scores in ascending order.
highscore.keypress(key)
-- If you're going to be using the fancyadd function you need to put
-- this function in the keypress function so the player can type their name.
-- Key: the key variable in the keypress function.
You can see a list of gamenames in use here to check for conflicts.
Please note this isn't secure at all. But i'm pretty sure fellow LÖVErs aren't of the corrupt type.