Explorar o código

Improve debug mode;

bjorn %!s(int64=10) %!d(string=hai) anos
pai
achega
30bc8c3774
Modificáronse 2 ficheiros con 3 adicións e 1 borrados
  1. 2 0
      game.lua
  2. 1 1
      pigeon.lua

+ 2 - 0
game.lua

@@ -37,6 +37,8 @@ function Game:load()
 end
 
 function Game:update()
+  self.debug = love.keyboard.isDown('`')
+
   self.pigeon:update()
   self.enemies:update()
   self.buildings:update()

+ 1 - 1
pigeon.lua

@@ -118,7 +118,7 @@ function Pigeon:draw()
   g.setColor(self.grounded and {0, 255, 0} or {255, 0, 0})
   g.line(x1, y1, x2, y2)
 
-  if false and debug then
+  if ctx.debug then
     g.setColor(255, 255, 255)
     local points = {self.feet.left.body:getWorldPoints(self.feet.left.shape:getPoints())}
     g.polygon('line', points)