Skip to content

Commit

Permalink
High scores table now adds default name if name was removed
Browse files Browse the repository at this point in the history
  • Loading branch information
waylon531 committed Mar 6, 2014
1 parent e14aacf commit 1ab1e45
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ function love.update(dt)
level="end"
text=""
textEnterable=true
print("gameover")
--print("gameover")
characterY=windowHeight-10000000
if difficulty==.2 then
contents= love.filesystem.read("highscores.csv")
Expand All @@ -161,20 +161,23 @@ function love.update(dt)
for i, v in ipairs(csv) do
if (i % 2 == 0) then
else
print(":")
print(score)
print(v)
print(":")
--print(":")
--print(score)
--print(v)
--print(":")
if tonumber(score) > tonumber(v) and highscore==false then
print(score)
print(v)
--print(score)
--print(v)
highscore=true
insert=i+1
table.insert(csv,i,core.round(score,6))
table.insert(csv,i+1,4)
table.remove(csv)
table.remove(csv)
score=v
if csv[10]==nil then
csv[10]="waylon"
end
end
end
end
Expand All @@ -183,7 +186,6 @@ function love.update(dt)
else
love.filesystem.write("highscoresdifficult.csv",core.toCSV(csv))
end

end
end
function love.mousepressed(x, y, button)
Expand Down

0 comments on commit 1ab1e45

Please sign in to comment.