Compare commits
3 commits
7f86166f8d
...
7e24a44617
| Author | SHA1 | Date | |
|---|---|---|---|
| 7e24a44617 | |||
| 8be9c21ba2 | |||
| 6a251b3619 |
4 changed files with 16 additions and 2 deletions
|
|
@ -33,7 +33,10 @@ function Room:draw()
|
|||
camera:attach(0, 0, gw, gh)
|
||||
self:canvasDraw()
|
||||
camera:detach()
|
||||
if DEBUG then love.graphics.print('DEBUG', 2, 2) end
|
||||
if DEBUG then
|
||||
love.graphics.print('objects: '..#self.area.game_objects,2,gh-16)
|
||||
love.graphics.print('DEBUG', 2, 2)
|
||||
end
|
||||
love.graphics.setCanvas()
|
||||
|
||||
love.graphics.setColor(255, 255, 255, 255)
|
||||
|
|
|
|||
|
|
@ -53,6 +53,12 @@ function Player:update(dt)
|
|||
-- move collision area
|
||||
self.collider:moveTo(self.x, self.y)
|
||||
|
||||
-- offscreen kill
|
||||
if self.x < 0-self.w then self:kill() end
|
||||
if self.y < 0-self.h then self:kill() end
|
||||
if self.x > gw+self.w then self:kill() end
|
||||
if self.y > gh+self.h then self:kill() end
|
||||
|
||||
if input:pressed('f11') then self:kill() end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,12 @@ function Projectile:update(dt)
|
|||
|
||||
-- move collision area
|
||||
self.collider:moveTo(self.x, self.y)
|
||||
|
||||
-- offscreen despawn
|
||||
if self.x < 0 then self:kill() end
|
||||
if self.y < 0 then self:kill() end
|
||||
if self.x > gw then self:kill() end
|
||||
if self.y > gh then self:kill() end
|
||||
end
|
||||
|
||||
---Draws Projectile
|
||||
|
|
|
|||
|
|
@ -41,7 +41,6 @@ end
|
|||
function CircleRoom:canvasDraw()
|
||||
CircleRoom.super.canvasDraw(self)
|
||||
love.graphics.setColor(1, 1, 1)
|
||||
love.graphics.print('objects: '..#self.area.game_objects,2,gh-16)
|
||||
end
|
||||
|
||||
return CircleRoom
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue