aboutsummaryrefslogtreecommitdiff
path: root/loading.lua
diff options
context:
space:
mode:
author1029chris <1029chris@gmail.com>2017-02-14 15:55:44 -0800
committer1029chris <1029chris@gmail.com>2017-02-14 15:55:44 -0800
commitdcf61eedc3f19af5a98ffd78439306ffe205ad77 (patch)
treed8154b113e47b15c150516310b0f7792275b63b7 /loading.lua
parentb093ea581294319fff10025501e09b90c4af3926 (diff)
Added save game/load game system
game auto saves when fight ends
Diffstat (limited to 'loading.lua')
-rw-r--r--loading.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/loading.lua b/loading.lua
index db36706..49af6bd 100644
--- a/loading.lua
+++ b/loading.lua
@@ -47,3 +47,16 @@ function drawPause()
love.graphics.setBackgroundColor(0, 128, 128)
end
end
+function loadSave()
+ if love.filesystem.exists("savegame.txt") == false then
+ love.filesystem.write("savegame.txt", "")
+ else
+ loadGame = love.filesystem.load("savegame.txt")
+ loadGame()
+ end
+ if love.filesystem.exists("profile.txt") == true then
+ loadProfile = love.filesystem.load("profile.txt")
+ loadProfile()
+ profile.setup = true
+ end
+end