Hi i need help with super mario game. I do not know how to use gravity on mushroom and enemies.... Mushroom and enemies go left and right but how to create gravity? For example enemy or mushroom fall to hole...
Develop games in your browser. Powerful, performant & highly capable.
Are you using any behaviors on the enemies or just moving them from events?
If so, you can have an event "For Each Object" from the System events and select the object you want to fall, then add a condition saying "Is overlapping" and select your ground object or the "Solid" attribute.
Next, right click this condition and choose "Invert". You can then add an event to increase the Y position of your object by a few pixels (eg: 5, or 10 for a faster fall speed)
If you are using the platform behavior on enemies/mushrooms you can use the Sprite -> "simulate control" -> move left action to make them move. That way, gravity is built in.