Goomba movement

Before proceeding, please use the forum search feature at the top of the page to check if your question has already been answered.

How do I…

Make goombas move correctly

What is the expected result

They move independently

What is the actual result

all you need is the gif below

Related screenshots

Goomba Movement.gif

What is your code for it can you send a screenshot

I can send you a Pic soon but I can’t now

It looks like it is working-ish…

However there are some issues with the way you are doing the collision. You do not need to repeat anything… already these two events are working on every goomba in the game, since all of them are either flipped or not flipped. Events work on all picked instances already!

Furthermore, you should not be using the “point inside” condition because it is not picking Goombas. It is picking Overworld_Grounds instead. Why not just use a normal collision (Goomba is in collision with Overworld_ground)

but with that then the goombas would always flip because top and bottom collisions exist

Oh, are they actually overlapping? In the collision condition, you can ignore objects that are touching bot not overlapping.

you could also check for Y position, if the ground objects are always rectangular then you can know if they are hitting the side by checking that the Y position of the ground object is greater than goomba.BoundingBoxBottom().

Okay, but the Overworld_Ground object is a tilemap

ah I see… in that case I think you would have to rely on keeping the X and Y collision separate.

As long as the bottom of the goomba hitbox is kept at least 1px away from the floor, you should be able to use collision with “ignore overlapping objects”