Gravity-Based Platform Game with Spaceship and Gravity zones

Get help using Construct 2

Post » Thu May 08, 2014 10:57 am

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 :D 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
You do not have the required permissions to view the files attached to this post.
B
8
S
2
G
1
Posts: 14
Reputation: 644

Post » Fri May 09, 2014 5:34 am

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.
Check out our WIP:BroodImage
B
9
S
1
G
2
Posts: 57
Reputation: 1,443

Post » Fri May 09, 2014 8:12 pm

Po10c wrote: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
You do not have the required permissions to view the files attached to this post.
B
8
S
2
G
1
Posts: 14
Reputation: 644

Post » Fri May 09, 2014 8:48 pm

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
You do not have the required permissions to view the files attached to this post.
Check out our WIP:BroodImage
B
9
S
1
G
2
Posts: 57
Reputation: 1,443

Post » Sat May 10, 2014 6:52 am

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.
Smooth.PNG
You do not have the required permissions to view the files attached to this post.
B
9
S
1
G
2
Posts: 57
Reputation: 1,443

Post » Sat May 10, 2014 5:12 pm

Po10c wrote: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.
Smooth.PNG


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
B
8
S
2
G
1
Posts: 14
Reputation: 644

Post » Sun May 11, 2014 9:12 pm

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
B
8
S
2
G
1
Posts: 14
Reputation: 644

Post » Thu May 29, 2014 9:27 am

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.
B
8
S
2
G
1
Posts: 14
Reputation: 644


Return to How do I....?

Who is online

Users browsing this forum: Baidu [Spider], DrKoala, irina, zenox98 and 25 guests