Difference between revisions of "Highscöre"
(removing this from the list, making room for HS2) |
|||
(7 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{#set:LOVE Version=0.7.x}} | {{#set:LOVE Version=0.7.x}} | ||
{{#set:Description=Easy highscore table creation.}} | {{#set:Description=Easy highscore table creation.}} | ||
− | |||
Highscöre is a library which creates simple highscore tables. | Highscöre is a library which creates simple highscore tables. | ||
− | Download it [ | + | Download it [https://dl.dropbox.com/u/37768120/libraries/highscore.lua here]. |
− | See also [[SICK]]. | + | See also [[SICK]] (read: SICK is better). |
Line 14: | Line 13: | ||
== How to use == | == How to use == | ||
− | First use [[love.filesystem.setIdentity]]. Also be sure to use the following line of code before using the functions: | + | First use [[love.filesystem.setIdentity]] or set the <code>identity</code> field in [[conf.lua]]. Also be sure to use the following line of code before using the functions: |
<source lang="lua">require "path/to/highscore.lua"</source> | <source lang="lua">require "path/to/highscore.lua"</source> | ||
− | |||
− | |||
Then you can start using the functions seen below. | Then you can start using the functions seen below. |
Latest revision as of 02:20, 25 October 2012
Highscöre is a library which creates simple highscore tables.
Download it here.
See also SICK (read: SICK is better).
Updates
v1.1 - 8/2/10 - Cleaned up some code a bit (replaced some while loops with for statements). Compatible with v1.0.
How to use
First use love.filesystem.setIdentity or set the identity
field in conf.lua. 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.