Add debug feature + fix collision
Getty Ritter
7 years ago
27 | 27 |
local c = self.board:passable(bx, by + 1)
|
28 | 28 |
local d = self.board:passable(bx + 1, by + 1)
|
29 | 29 |
|
30 | |
if not (a and b and c and d) then return false end
|
31 | |
|
32 | 30 |
if alignX and alignY then
|
33 | 31 |
return a
|
34 | 32 |
elseif alignX then
|
|
50 | 48 |
|
51 | 49 |
function Entity:move(board)
|
52 | 50 |
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
|
53 | 57 |
|
54 | 58 |
if self.dx > 0 then
|
55 | 59 |
self.direction[1] = 2
|
15 | 15 |
function love.load()
|
16 | 16 |
state.t = 0
|
17 | 17 |
state.message = nil
|
| 18 |
debug = ''
|
18 | 19 |
state.board = board.Board:new()
|
19 | 20 |
state.char = entity.Entity:new(state.board, 3 * 24, 3 * 24, tile.getTile('character'))
|
20 | 21 |
|
|
101 | 102 |
love.graphics.print(state.message, 12, h + 12)
|
102 | 103 |
end
|
103 | 104 |
|
| 105 |
love.graphics.print(debug, 8, 8)
|
| 106 |
|
104 | 107 |
love.graphics.setCanvas()
|
105 | 108 |
|
106 | 109 |
love.graphics.setColor(255, 255, 255)
|