[Help] Invert Gravity

Hello, quick question. I’m making a platform demo demo for a Game Design exam. Now, the main mechanic of the game is to let the player to be upside down and invert the gravity of the level. Now I managed to rotate the camera, but I still can’t do the trick with the gravity. Is there an event that I might use to do that?

As you can see from the photo, the character (that uses the standard platform behavior) needs to use the upside down mechanic to make collision with a spring that will make him jump higher and reach the other side of the level. Thx in advance and sorry for the poor grammar.

Try using these actions on collision with your spring object:

Rotate player towards 180 degrees
Add to player an instant force, angle 90 degrees

There are speed settings for it, but I’m not sure how fast it should be for your game. Also, the settings I have here for degrees are due to my player object, it may be different for yours.

Check out these wiki pages too:

http://wiki.compilgames.net/doku.php/gdevelop5/tutorials/basic-game-making-concepts#coordinates

http://wiki.compilgames.net/doku.php/gdevelop5/objects/base_object#angle

Edit: I might have misunderstood. To clarify, what I said above is for what happens on collision with the spring. I don’t think it would work for making your object use platforms upside down, but you might still need to use coordinates and angles to achieve that.

Yeeeeahhhh, inverting gravity sounds a little tricky because you’d probably have to change specific things about the Platformer Behavior - which I don’t think is something you can do just through events.

Surely, there are workarounds - like creating an invisible platform right under your character when it touches the “upside down” platform, thus keeping it from falling, and make it the same width as the upside down platform as well so that when your character falls off the invisible platform it’ll just fall back down onto the next one.
I think this is how I would do it at least, when done right it could give the feeling of inverted gravity quite well! Just not as dynamic as having actual inverted gravity, though - and you probably wouldn’t be able to jump if you had the invisible platform too, unless you took more time to make that work with events as well.

And then, there’s always the possibility to “make” your own platformer-like behavior through events in a way where it supports the inverted gravity function! It’s not as practical, surely, but it’s the way that will give the most stable results, I’d imagine.

I hope you’ll figure something out! If you do, let me know, I’m curious about this too!

I tried applying an instant force, angle 270 but nothing happens since the force pushes just in one frame. Tried with a permanent force and it kinda works, but it keeps pushing and makes jumps impossible. It also clips with my moving platform. Thanks anyway.

Update: I managed to almost get it, by setting the gravity to a minus value when the key is pressed. Still, I can’t get the inverted gravity jump right, even with a minus jump speed.

Does your character have platformer behavior? Because if it does, you can change the gravity in Add action > Platformer behavior > Options > Gravity.

EDIT: Missed your reply. Do you mean that it’s not reaching its max. jump speed?

I mean it just stays on the platform, even with -600 jump speed.

EDIT: I tried minusing all the platform behavior values to the event’s conditions, but makes the jump too high and moves the object towards the left. Probably I should use specific minus values.

I’m not sure but I think you can try to add a positive force (because the coordinate system in GDevelop is inverted) in the Y direction. This should move your object in the downward direction. Also, enter a force higher than the gravity you set for the object.

I know how to fix this

-5 On Y To get it to go up 5 On Y The get it to go down -5 On X to get it to go left 5 On X the get it to go right
Only works in the Physic engine 2 I got a tutorial on how to do it with the platformer :smiley: just ask me BTW

I’m working on a game called Malware 5 Gen

Best photo editor with glow effects and video tutorials. ( Pixlr.com ) Use this for making game art like a banner
Best Soundtrack maker. ( boscaceoil )

Here is an template you can use

Please do not bump 2 year old threads.

1 Like