bunq
if self.turnaroundoncliff and self.falling == false then
--check if nothing below
local x = math.floor(self.x + self.width/2+1)
local y = math.floor(self.y + self.height+1.5)
if inmap(x, y) and tilequads[map[x][y][1]].collision == false and ((inmap(x+.5, y) and tilequads[map[math.ceil(x+.5)][y][1]].collision) or (inmap(x-.5, y) and tilequads[map[math.floor(x-.5)][y][1]].collision)) then
if self.speedx < 0 then
self.animationdirection = "left"
self.x = x-self.width/2
else
self.animationdirection = "right"
self.x = x-1-self.width/2
end
self.speedx = -self.speedx
end
end
{0, 1, 2, butt} > 3 4 5 6 .. 7 < 8 . 9 .