浏览代码

Improve debug mode;

bjorn 10 年之前
父节点
当前提交
30bc8c3774
共有 2 个文件被更改,包括 3 次插入1 次删除
  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)