Gravity-Based Platform Game with Spaceship and Gravity zones

0 favourites
  • 8 posts
From the Asset Store
3D Rendered, High Resolution elements to create an apocalytic scene or war zone
  • Hi! I'm having a problem with my new prototype. I have tried to solve it for a few days now, but haven't been able to do it, so decided to ask you guys for help.

    My project is a gravity-based platformer game, where you can fly a spaceship in a planet's atmosphere and also in space, where the planet's gravity doesn't affect it. When the spaceship is in the planet's atmosphere, I have used the "platform behavior" to get the gravity to work. The player's angle and angle of gravity are both towards the middle of the planet.

    When the spaceship exits the planet's atmosphere, I want the angle of gravity and the spaceship's angle to reset so that there I can create an Asteroids- type movement. (see the attached pic).

    So: I get the movement to work in the atmosphere and space the way I want, but I can't get them to work in the same preview. Only one of those work.

    Details for the picture:

    1. The spaceship is in the surface of the planet, and player can get in and out of the spaceship.

    2. The spaceship is in the planet's atmosphere, and affected by the gravity of the planet. The spaceship can move up, right and left (made with the x- and y-vectors of Platform Behavior). The bottom of the spaceship faces the planet at all times.

    3. The spaceship is in the non-gravity area (space) and is not affected by any gravity. It can move in similar way as in the game Asteroids.

    Sorry for the confusing text and thank you in advance for any help! Feel free to ask for more details if needed. Unfortunately I will not add the .capx file to this post because it is waaay too confusing at the moment.

    -Sentenc3d1

  • Am I correct in thinking that you use the platform behavior only in the atmosphere?

    You can try something like "Ship is NOT overlapping Atmos > Platform behaviour - Disable" and set that to once if true.

    Then place your movements in separate event groups, and enable disable the one you want on the transition.

  • Am I correct in thinking that you use the platform behavior only in the atmosphere?

    You can try something like "Ship is NOT overlapping Atmos > Platform behaviour - Disable" and set that to once if true.

    Then place your movements in separate event groups, and enable disable the one you want on the transition.

    Thank you for your response! I tried your advice in a few different ways but didn't get them to work the way I wanted. There seems to be a problem always with when going to a non-gravity zone. There are either no changes in the gravity or in the way the spaceship moves. Sometimes the spaceship doesn't even get out of the atmosphere to non-gravity zone, and sometimes the ship freezes in between the atmosphere and space when disabling the platform behavior. So every one of these problems appeared with different sets of events.

    I'm quite a newbie in C2 so maybe I can't solve these problems as creatively as you guys.. Here's a screenshot of the events you suggested. I didn't get them to work, so maybe I did something wrong?

    Thanks again for helping!

    -Sentenc3d1

  • I have modified the example Capx called Rotating platformer to do what you want.

    Use 8 Dir movement for space and you're good to go:-)

    See attached file

  • The buggy transition in the capx I provided can be fixed by smoothly changing the angle back to 0,and making the conditions for the transfer Exclusive as shown. It can be perfected by ensuring enough space between the "boundaries". I also think you can make it look cool by scaling the layer down as the ship enters space.

    [attachment=0:s9w51pgk][/attachment:s9w51pgk]

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • The buggy transition in the capx I provided can be fixed by smoothly changing the angle back to 0,and making the conditions for the transfer Exclusive as shown. It can be perfected by ensuring enough space between the "boundaries". I also think you can make it look cool by scaling the layer down as the ship enters space.

    [attachment=0:2v7012qz][/attachment:2v7012qz]

    Thanks a lot! I think that the answer is getting closer now. I wonder why it doesn't work with custom movement, because I would get much better movement with that (or so I think)? And why the ship turns upside down when entering space?

    Thanks again.

    -Sentenc3d1

  • Still needing help. I'm quite confused right now. Why can't I put Custom movement (see pic) instead of 8-direction to the spaceship's behavior? And if there isn't any way to get the custom movement to work, how can I get the 8-direction to work so that the spaceship doesn't do a flip when leaving the atmosphere and entering space?

    If I cannot make custom movement to work, is there any other way to get an Asteroids- type movement to the spaceship?

    Thanks !

    -Sentenc3d1

  • I still have the same problem. Haven't got much time to solve the problem myself because i'm working. But i'm trying to continue the project so all help is welcome.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)