Skip to content

Instantly share code, notes, and snippets.

@crumblingstatue
Created March 30, 2014 14:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crumblingstatue/d33fbaff54a0b0d1a017 to your computer and use it in GitHub Desktop.
Save crumblingstatue/d33fbaff54a0b0d1a017 to your computer and use it in GitHub Desktop.
diff --git a/main.lua b/main.lua
index 8c4d52c..97e498c 100644
--- a/main.lua
+++ b/main.lua
@@ -36,17 +36,12 @@ function love.load()
enemy.load()
powerup.load()
- --HIGHSCORE SAVE
- highscore = {}
+ --HIGHSCORE LOAD
+ local scores = love.filesystem.load("scores.lua")
- if not love.filesystem.exists("scores.lua") then
- scores = love.filesystem.newFile("scores.lua")
- end
- for lines in love.filesystem.lines("scores.lua") do
- table.insert(highscore, lines)
- end
- love.filesystem.write("scores.lua","player.highscore\n=\n" .. player.highscore)
- player.highscore = highscore[3]
+ if scores then
+ scores()
+ end
end
--
function love.mousepressed(x,y)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment