Added settings file reading and writing.
This commit is contained in:
7
main.lua
7
main.lua
@@ -4,6 +4,7 @@
|
||||
|
||||
local love = require 'love'
|
||||
local game_states = require 'src.states'
|
||||
local settings = require 'src.utils.settings'
|
||||
local Fader = require 'src.utils.fader'
|
||||
|
||||
|
||||
@@ -36,6 +37,9 @@ end
|
||||
function love.load(args)
|
||||
parse_args(args)
|
||||
|
||||
-- Obtain the settigns for the game.
|
||||
settings:load_settings()
|
||||
|
||||
-- Load the assets of the intro game state.
|
||||
game_states[Current_state]:load()
|
||||
|
||||
@@ -61,6 +65,9 @@ function love.update(dt)
|
||||
if Fade.done then
|
||||
game_states[Current_state]:unload(dt)
|
||||
love.event.quit()
|
||||
|
||||
-- Save the settings before quitting just in case.
|
||||
settings:load_settings()
|
||||
end
|
||||
else
|
||||
-- If the new state exists then unload it's data and set the new state.
|
||||
|
||||
Reference in New Issue
Block a user