Highscore.lua

From Moondust Wiki
Jump to navigation Jump to search

A small library that keeps track of highscores in played levels.

Download 1.0: http://hastebin.com/hugipenuso.lua

Installation

Place the file the text provided above in a file named highscore.lua. Place highscore.lua into the LuaScriptsLib folder.

Variables

completionOnly
boolean

If true then highscores will only be saved if the player beats a level. (Otherwise the highscore will be saved on death as well). (Default: false)

resetScore
boolean

SMBX doesn't by default reset scores when loading levels; when set to true this will do so. (Default: true)

text
number

Text to be displayed with the highscore. If nil then no text will be displayed. (Default: highscore)

textX
int

X-position to print the highscore text at. (Default: 10)

textY
int

Y-position to print the highscore text at. (Default: 16)

scoreX
int

X-position to print the highscore at. (Default: 20)

scoreY
int

Y-position to print the highscore at. (Default: 36)

Function

reset
nil

Resets the highscore of the loaded level.