Difference between revisions of "Highscöre"

(No one will see this on the forum, and it could be a big help to people, so...)
 
(Highscöre v2, see also SICK)
Line 5: Line 5:
  
 
Download it [http://tesselode.110mb.com/love_highscore_functions.zip here].
 
Download it [http://tesselode.110mb.com/love_highscore_functions.zip here].
 +
 +
See also [[SICK]].
 +
 +
 +
== Updates ==
 +
'''v1.1 - 8/2/10''' - Cleaned up some code a bit (replaced some while loops with for statements).
  
  

Revision as of 16:17, 2 August 2010

Highscöre is a library which creates simple highscore tables.

Download it here.

See also SICK.


Updates

v1.1 - 8/2/10 - Cleaned up some code a bit (replaced some while loops with for statements).


How to use

First use love.filesystem.setIdentity. Also be sure to use the following line of code before using the functions:

require "path/to/highscore.lua"

Then you can start using the functions seen below.


Functions

highscore_new(filename, places, name, score)

filename - Name of text file where highscore table is stored.

places - Number of places in highscore table.

name - Name for "Nobody."

score - Score for "Nobody."

Creates an empty highscore table. Use this if the highscore table doesn't exist yet.


highscore_load(filename)

filename - Name of text file to load highscore table from.

Loads a highscore table. Be sure to use this before using highscore_add or highscore_write!


highscore_write(filename)

filename - Name of text file to write highscore table to.

Writes the currently stored high scores. You'll probably want to use this after using highscore_add.


highscore_add(score, name)

score - Score to enter into highscore table.

name - Name that goes with score.

Enter a score into the highscore tale.