diff options
author | Aki <nthirtyone@gmail.com> | 2017-04-06 19:59:51 +0200 |
---|---|---|
committer | Aki <nthirtyone@gmail.com> | 2017-04-06 19:59:51 +0200 |
commit | a013d70115171764ce0941fbbe18a5447447a7eb (patch) | |
tree | d284c3c331bbe144d61ebeab9cf86ce58b4b253a | |
parent | 8190d59e7bbac7835e9cecf5229247900b21f84a (diff) | |
download | roflnauts-a013d70115171764ce0941fbbe18a5447447a7eb.zip roflnauts-a013d70115171764ce0941fbbe18a5447447a7eb.tar.gz roflnauts-a013d70115171764ce0941fbbe18a5447447a7eb.tar.bz2 |
Settings moved to /not/, cleaned-up a bit
-rw-r--r-- | main.lua | 2 | ||||
-rw-r--r-- | not/Settings.lua (renamed from settings.lua) | 12 |
2 files changed, 10 insertions, 4 deletions
@@ -28,7 +28,7 @@ require "not.World" require "camera" require "not.Menu" require "controller" -require "settings" +require "not.Settings" -- Temporary debug debug = false diff --git a/settings.lua b/not/Settings.lua index e73b997..e3316f9 100644 --- a/settings.lua +++ b/not/Settings.lua @@ -1,5 +1,9 @@ -Settings = {} -Settings.current = {} +--- `Settings` +-- Stores, loads, saves and changes game settings including Controller sets. +Settings = { + current = {} +} + function Settings.load() if Controller then if not love.filesystem.exists("settings") then @@ -27,6 +31,7 @@ function Settings.load() end end end + function Settings.save() local new = love.filesystem.newFile("settings") local sets = Settings.current @@ -51,6 +56,7 @@ function Settings.save() new:write(string) new:close() end + function Settings.change(n, left, right, up, down, attack, jump, joystick) local bool if joystick then @@ -63,4 +69,4 @@ function Settings.change(n, left, right, up, down, attack, jump, joystick) Settings.save() -- Load settings Settings.load() -end
\ No newline at end of file +end |