Added settings file reading and writing.

This commit is contained in:
2025-09-28 19:29:19 -04:00
parent 9cec7f10db
commit 79bb1fdb0d
3 changed files with 154 additions and 0 deletions

View File

@@ -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.