Note: Reloading the mapeditor while it is already loaded will break the code due to a currently unknown bug - if reloading is required, switch to menu and switch to the mapeditor
F9: load the default map and play it
Deletes GUI childs on the rootcontainer
Note: won't show up highscore nor does the level end, this works only if started from the menu
Implements a think method that either calls game:think, menu:think or level:think
Resource management. Stores models, sounds and textures in global tables.
mdl: model files
snd: sound files
tex: texture files
Each table contains its resource fields.
adding particle scripts
automatic loading of files
Namings are not dependent on file names, namings might be changed
Creates class named "Options" and instantiates a global value named "gameoptions".
gameoptions.cfg contains configuration settings
gameoptions:set(key,value) can set a generic key value which will be saved in the cfg table. Also saves the change in the config.cfg file
Creates class named "Highscores" and instantiates a global value named "highscores".
highscores.scores is a table that contains sorted list of highscore holdes, where
.name: callsign (usually three letters)
.points: achieved points
.date: dd.mm.yyyy string
Must be rewritten so it can store scores for different map files
Anticheating is a waste of time on such a project - but this would be the first place to make it more safe
Handles the postprocessing effects like blur and distortions. Creates a global table named "postfx". Contains further functions that allow modification of effects.
postfx.glow: Glow effect handle
postfx.glow.strength(number): strength of glow
postfx.glow.eff:thres(number): how bright must the color be in order to be used for the glow effect
postfx.distort: Distortion effect handle
Manages the mainmenu gui. Creates a global named "menu".
Loads "level0.lua" as game. Deletes all enemy nodes from the game, disables the think of the player's ship and calls the think method. Steers the player's ship to follow and shoot the mouse cursor. Moves the camera of the game object slowly up. No idea how long this will take to move the entire level, but the level (a testlevel) is really pretty long.
menu:showMenu(component,title = "Sparc")
Shows a component in the box. The size of the component is used to change the menu container's size. All menupages are using this function to create their GUI.
local functions: addlabel, addrect, addbutton - helpers to add greenish components to a container
Allow starting different levels
Show information on levels
Show level dependent highscores
Think about a system how to save / load play states, must be implemented in game.lua
shooting the mouse is boring. Clicking somewhere should spawn an extra which the ship trys to collect.