fixed level jump
This commit is contained in:
2
main.lua
2
main.lua
@@ -37,7 +37,7 @@ if os.getenv("LOCAL_LUA_DEBUGGER_VSCODE") == "1" then
|
|||||||
function love.load()
|
function love.load()
|
||||||
love.window.setTitle('SpiderCut')
|
love.window.setTitle('SpiderCut')
|
||||||
love.graphics.setDefaultFilter('nearest', 'nearest')
|
love.graphics.setDefaultFilter('nearest', 'nearest')
|
||||||
love.graphics.setLineJoin( "miter" )
|
love.graphics.setLineJoin( "bevel" )
|
||||||
math.randomseed(os.time())
|
math.randomseed(os.time())
|
||||||
|
|
||||||
push:setupScreen(VIRTUAL_WIDTH, VIRTUAL_HEIGHT, WINDOW_WIDTH, WINDOW_HEIGHT, {
|
push:setupScreen(VIRTUAL_WIDTH, VIRTUAL_HEIGHT, WINDOW_WIDTH, WINDOW_HEIGHT, {
|
||||||
|
|||||||
@@ -8,17 +8,10 @@ function Level:init(stage)
|
|||||||
self.segments = self:createLevel()
|
self.segments = self:createLevel()
|
||||||
self.polygon = self:createPolygon()
|
self.polygon = self:createPolygon()
|
||||||
self.mesh = poly2mesh(self.points)
|
self.mesh = poly2mesh(self.points)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function Level:update(dt)
|
function Level:update(dt)
|
||||||
-- print_r(self.points)
|
|
||||||
-- print(tostring(#self.points))
|
|
||||||
-- if self.mesh == nil and #self.points > 2 then
|
|
||||||
-- self.mesh = poly2mesh(self.points)
|
|
||||||
-- end
|
|
||||||
self.mesh = poly2mesh(self.points)
|
self.mesh = poly2mesh(self.points)
|
||||||
-- print_r(self.mesh:getVertices())
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function Level:render()
|
function Level:render()
|
||||||
|
|||||||
@@ -71,15 +71,6 @@ function PlayState:updateBalls(dt, level)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if #self.balls <= 0 then
|
|
||||||
-- game over - reset level
|
|
||||||
self:gameOver()
|
|
||||||
end
|
|
||||||
|
|
||||||
-- check perimeter of level, if low enough, create new level move on to the next stage
|
|
||||||
if level:getPerimeter() < 500 then
|
|
||||||
self:nextStage()
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function PlayState:checkEndLevel (level)
|
function PlayState:checkEndLevel (level)
|
||||||
|
|||||||
Reference in New Issue
Block a user