gdritter repos animaltransiro / e13c4dc
Add debug feature + fix collision Getty Ritter 6 years ago
2 changed file(s) with 9 addition(s) and 2 deletion(s). Collapse all Expand all
2727 local c = self.board:passable(bx, by + 1)
2828 local d = self.board:passable(bx + 1, by + 1)
2929
30 if not (a and b and c and d) then return false end
31
3230 if alignX and alignY then
3331 return a
3432 elseif alignX then
5048
5149 function Entity:move(board)
5250 local movement = true
51
52 debug = string.format(' {x=%d, y=%d}\n', self.x, self.y)
53
54 if self.dx == 0 and self.dy == 0 then
55 return
56 end
5357
5458 if self.dx > 0 then
5559 self.direction[1] = 2
1515 function love.load()
1616 state.t = 0
1717 state.message = nil
18 debug = ''
1819 state.board = board.Board:new()
1920 state.char = entity.Entity:new(state.board, 3 * 24, 3 * 24, tile.getTile('character'))
2021
101102 love.graphics.print(state.message, 12, h + 12)
102103 end
103104
105 love.graphics.print(debug, 8, 8)
106
104107 love.graphics.setCanvas()
105108
106109 love.graphics.setColor(255, 255, 255)