Fixed camera bug
This commit is contained in:
@@ -88,6 +88,11 @@ function Game.new(core)
|
||||
self.core = core
|
||||
self.input = baton.new(input.player)
|
||||
|
||||
self.camera = Camera.new(
|
||||
(1 + 2 * 24) * TILE_SIZE,
|
||||
(1 + 2 * 24) * TILE_SIZE
|
||||
)
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
@@ -99,11 +104,6 @@ function Game:enter(level, startTime)
|
||||
self.level = level or 1
|
||||
self.env.mazeWidth, self.env.mazeHeight = difficulty.getMazeSize(self.level)
|
||||
|
||||
self.camera = Camera.new(
|
||||
(1 + 2 * self.env.mazeWidth) * TILE_SIZE,
|
||||
(1 + 2 * self.env.mazeHeight) * TILE_SIZE
|
||||
)
|
||||
|
||||
-- Init environment
|
||||
self.world = bump.newWorld(TILE_SIZE)
|
||||
self.env.walls, self.env.maze, self.env.entrance, self.env.exits = initMaze(
|
||||
|
||||
@@ -163,7 +163,6 @@ end
|
||||
--
|
||||
|
||||
function Worm:_findSpawnPoint()
|
||||
print('env', self.game.env.nodes)
|
||||
local pos = random.chooseUntil(self.game.env.nodes, function(element)
|
||||
local distanceToPlayer = vector.dist(element.x, element.y, self.game.player:getPos())
|
||||
local isFarEnough = distanceToPlayer > self.stats.spawnDistanceFromPlayer
|
||||
|
||||
Reference in New Issue
Block a user