Love:Mike: Timer now saves/loads
This commit is contained in:
@@ -22,13 +22,13 @@ function love.load()
|
||||
|
||||
|
||||
actors.start = love.timer.getTime()
|
||||
local end_timer = 0
|
||||
actors.end_timer = 0
|
||||
end
|
||||
|
||||
function love.update(dt)
|
||||
actors.player = check_keys(actors.player, screen, dt)
|
||||
actors.ball = ball_bounce(actors.player, actors.ball, dt)
|
||||
end_timer = love.timer.getTime() - actors.start
|
||||
actors.end_timer = love.timer.getTime() - actors.start
|
||||
end
|
||||
|
||||
function love.draw()
|
||||
@@ -48,6 +48,6 @@ function love.draw()
|
||||
love.graphics.print("Score: "..actors.ball.score, screen.width -80, 10)
|
||||
--Timer
|
||||
love.graphics.setColor(125,42,19)
|
||||
love.graphics.print(string.format("Time M: %.2f", end_timer/60), screen.width -85, 50)
|
||||
love.graphics.print(string.format("Time S: %.2f", end_timer), screen.width -85, 30)
|
||||
love.graphics.print(string.format("Time M: %.2f", actors.end_timer/60), screen.width -85, 50)
|
||||
love.graphics.print(string.format("Time S: %.2f", actors.end_timer), screen.width -85, 30)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user