gdritter repos animaltransiro / 0b365e4
Fixed interacting in certain directions Getty Ritter 6 years ago
1 changed file(s) with 3 addition(s) and 3 deletion(s). Collapse all Expand all
4949 function Entity:move(board)
5050 local movement = true
5151
52 debug = string.format(' {x=%d, y=%d}\n', self.x, self.y)
52 debug = string.format(' {x=%d, y=%d, gx=%d, gy=%d}\n', self.x, self.y, self:gameCoords())
5353
5454 if self.dx == 0 and self.dy == 0 then
5555 return
5656 end
5757
5858 if self.dx > 0 then
59 self.direction[1] = 2
59 self.direction[1] = 1
6060 elseif self.dx < 0 then
6161 self.direction[1] = -1
6262 elseif self.dy ~= 0 then
6464 end
6565
6666 if self.dy > 0 then
67 self.direction[2] = 2
67 self.direction[2] = 1
6868 elseif self.dy < 0 then
6969 self.direction[2] = -1
7070 elseif self.dx ~= 0 then