Code: Select all
--movement for ghost
if distX > 0 then
ghost.x = ghost.x + 1
elseif distX < 0 then
ghost.x = ghost.x - 1
end
if distY > 0 then
ghost.y = ghost.y + 1
elseif distY < 0 then
ghost.x = ghost.x - 1
end
Code: Select all
--movement for ghost
if distX > 0 then
ghost.x = ghost.x + 1
elseif distX < 0 then
ghost.x = ghost.x - 1
end
if distY > 0 then
ghost.y = ghost.y + 1
elseif distY < 0 then
ghost.x = ghost.x - 1
end
Code: Select all
elseif distY < 0 then
ghost.x = ghost.x - 1
your right, it was just that, because i had 2 statments changing the x and no y, it cancelled the movements for left and there was no upwards movement, thank you!!darkfrei wrote: ↑Thu Mar 13, 2025 6:05 pmX or y?Code: Select all
elseif distY < 0 then ghost.x = ghost.x - 1
Users browsing this forum: Amazon [Bot], Bing [Bot], Google [Bot], Semrush [Bot] and 10 guests