Search found 2 matches

by warmthunder51
Fri Mar 14, 2025 3:45 pm
Forum: Support and Development
Topic: Making an enemey follow the player
Replies: 3
Views: 139

Re: Making an enemey follow the player

darkfrei wrote: Thu Mar 13, 2025 6:05 pm

Code: Select all

elseif distY  < 0 then
   ghost.x = ghost.x - 1
X or y?
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!!
by warmthunder51
Tue Mar 11, 2025 1:55 pm
Forum: Support and Development
Topic: Making an enemey follow the player
Replies: 3
Views: 139

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...