Fixed interacting in certain directions
Getty Ritter
8 years ago
| 49 | 49 | function Entity:move(board) |
| 50 | 50 | local movement = true |
| 51 | 51 | |
| 52 |
debug = string.format(' {x=%d, y=%d |
|
| 52 | debug = string.format(' {x=%d, y=%d, gx=%d, gy=%d}\n', self.x, self.y, self:gameCoords()) | |
| 53 | 53 | |
| 54 | 54 | if self.dx == 0 and self.dy == 0 then |
| 55 | 55 | return |
| 56 | 56 | end |
| 57 | 57 | |
| 58 | 58 | if self.dx > 0 then |
| 59 |
self.direction[1] = |
|
| 59 | self.direction[1] = 1 | |
| 60 | 60 | elseif self.dx < 0 then |
| 61 | 61 | self.direction[1] = -1 |
| 62 | 62 | elseif self.dy ~= 0 then |
| 64 | 64 | end |
| 65 | 65 | |
| 66 | 66 | if self.dy > 0 then |
| 67 |
self.direction[2] = |
|
| 67 | self.direction[2] = 1 | |
| 68 | 68 | elseif self.dy < 0 then |
| 69 | 69 | self.direction[2] = -1 |
| 70 | 70 | elseif self.dx ~= 0 then |