Highscore.lua

From Moondust Wiki
Jump to navigation Jump to search
This is the archived page of the old LunaLua documentation
The rest of LunaLua related articles in this wiki contain a lot of outdated documentation preserved for historical purposes and may be used with legacy versions of the LunaLua.
Please visit the SMBX2 Documentation Page to access the latest documentation for the LunaLua scripting system of the SMBX2 Project.
Adding LunaLua contents into this Wiki is not advised.

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.