Added level completed menu state and removed debug prints
This commit is contained in:
parent
13c2ca1558
commit
0eb2138a75
2 changed files with 43 additions and 27 deletions
21
main.lua
21
main.lua
|
|
@ -27,11 +27,8 @@ function love.update( dt )
|
|||
if InMenu then
|
||||
Menu:update( dt, Point:new( Mouse.x, Mouse.y ), Mouse.pressed )
|
||||
else
|
||||
if Input:actionReleased( 'nextlevel' ) then
|
||||
if GameGrid:isCompleted() then
|
||||
GameGrid = LevelHandler:next()
|
||||
Menu.updateCellSize()
|
||||
end
|
||||
if GameGrid:isCompleted() and not Mouse.pressed then
|
||||
Menu.current_state = MenuStateIndex.completed
|
||||
end
|
||||
end
|
||||
-- Switch menu state or exit
|
||||
|
|
@ -55,19 +52,5 @@ function love.draw()
|
|||
else
|
||||
love.graphics.setLineWidth( Config.cellSize * Config.lineWidth )
|
||||
GameGrid:draw()
|
||||
|
||||
local text = string.format( "%d:%d global\n%d:%d local\n%d:%d from start", Mouse.x, Mouse.y, Mouse.point.x, Mouse.point.y, Mouse.startX - Mouse.x, Mouse.startY - Mouse.y )
|
||||
love.graphics.print( text, 64, 256 )
|
||||
|
||||
if Mouse.dragged then
|
||||
love.graphics.print( "drag", 64, 300 )
|
||||
end
|
||||
if Mouse.lastLine ~= nil then
|
||||
love.graphics.print( tostring( Mouse.lastLine ), 128, 300 )
|
||||
end
|
||||
|
||||
if GameGrid:isCompleted() then
|
||||
love.graphics.print( "Grid completed. Press space to proceed to next", 64, 320 )
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue