Pac-Man Helpppppp

Hi! Im currently working on a pac-man based game. I have a few question!

  1. How can i make the player move like in the pac-man game. I am using top down movement and it work fine. But this extension only allow the character to move when the player pressing button, when in the pac-man game, the character will move permanently and only stop when hitting the wall.
  2. The monster movement: I am using the changing X and Y position for the monster movement, and size everthing 64x64. Each 0,4s, the monster will changing 64px. And to make the monster move randomly, I have a 64x64 box, and when the monster’s center point is in the box, the direction variable will be changed randomly and they will have random pathing. But the problem is when the monster changing their X and Y position 64 px, they will look like they are teleporting, not moving. So how can I make them look like they are moving while still using the changing X and Y position method, because only using this method can make my changing direction box work.

Use a variable to keep track of which direction the latest keypress makes the character move. Then use a simulate key press action depending on the current direction

Look at using a tween, so you tween to the new position (using the linear easing function). For example, instead of changing the X position by adding 64, tween the X position to Cooker.X() + 64.

1 Like

Thanks I have solved the first problem!
About the second problem, I have tried tween and they move perfectly, but as I have set the condition that when the monster’s center point is inside the collision mask of the changing direction box, the monster will instantly move and get stuck to the wall. So they need to be inside the box immediately. Do you have any suggestion for this problem ?

Try adding a Trigger once condition on each of those events.

1 Like

Sorry for the late response, I have added a trigger once condition on each of those event but it didn’t work too. According to my condition sheet, when the center point of the monster is inside the box, their direction is changed randomly, so if they are moving right or left, and they change to moving up or down, only half of their body are in the way, and the other half will get block by the wall

That sounds like you’ll need to use the action that separates 2 objects, to move the Monster away from the wall. Add that to the direction randomising event.

1 Like

I did use that action to make the monster and player get block by the wall from the start!