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
Search found 2 matches
- Fri Mar 14, 2025 3:45 pm
- Forum: Support and Development
- Topic: Making an enemey follow the player
- Replies: 3
- Views: 141
Re: Making an enemey follow the player
- Tue Mar 11, 2025 1:55 pm
- Forum: Support and Development
- Topic: Making an enemey follow the player
- Replies: 3
- Views: 141
Making an enemey follow the player
Hello, I recently got into lua and love2d, I'm trying to make a very basic pac-man clone. Current I have a ghost as a circle that chases you but I cannot seem to figure out the code for it. --movement for ghost if distX > 0 then ghost.x = ghost.x + 1 elseif distX < 0 then ghost.x = ghost.x - 1 end i...