How do I : Platform Behavior

Get help using Construct 2

Post » Sun Mar 15, 2015 1:11 pm

I am creating a prototype of Jetpack type game where the player flies and need to land on a platform on a projectile path.

For the Player I have enabled two behaviors 1) platform and 2) physics. Given below are the key events/+actions I am using.

1) For Player Jump/Jetpack -> On key Press, apply impulse of 0.2 to coordinates ( Player.X+10, Player.Y-10)
2) To get the Parabolic Path of fall -> On release of key Press, apply impulse of 0 to angle 0 of the player

The issues I am getting are given below. If anyone can help it will be great.

1) The player is always shaking while standing on the platform. I have given the video link http://youtu.be/fsXKTc3HNSw . Please note that if I make set world gravity to 0 when the player is on the platform the shake is stopped.
2) Even when the player is landing on the platform, it constantly triggers events related to Platform Falling. Why would that be?
B
5
S
1
Posts: 41
Reputation: 466

Post » Sun Mar 15, 2015 1:35 pm

for number 1) try to change your bounding box/collision polygon of the player sprite or even better: make an invisible sprite that is set at the position of your player and handles the collision/physics, and turn collision/physics for your player sprite off

for number 2) without seeing your code i don't know, but physics is always problematic, special in fast action games. I always try to avoid physics and only use it, if i don't find another solution for getting the behavior i need.
B
11
S
2
Posts: 213
Reputation: 1,266

Post » Sun Mar 15, 2015 4:50 pm

1) I can use the invisible sprite method to take care of the collision part. My worry remains that collision block would continue to shake and hence some of the physics would misbehave. Like the events of "Platform is falling" are continuously getting triggered while the platform is on landing position is not correct, is suppose. Need to find a way to stop the shake.

2) I have attached the project here for enabling you to review the code. If you can think of an alternative approach I would be happy to try out.

https://dl.dropboxusercontent.com/u/749 ... /JUMP.capx
B
5
S
1
Posts: 41
Reputation: 466

Post » Mon Mar 16, 2015 12:08 am

Ok, i didn't see it, when i read your first post. You are using platform behavior & physics together, what is not a good idea to do. So, you have 2 solutions: stay with platform behavior and put the physics out (most time the better idea, for one game like this you don't really need physics) and emulate the physics behavior (for your player falling for example you can use 'simulate control pressing down')

or

you stay with physics and change the conditions to physic ones, like comparing y-velocity for falling etc.
B
11
S
2
Posts: 213
Reputation: 1,266

Post » Mon Mar 16, 2015 7:57 am

This is something that should be highlighted more strongly in the manual, but it is pointed to here: https://www.scirra.com/manual/98/physics.

Basically, physics and other behaviors don't mix very well and can cause unpredictable results, such as teleporting.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
129
S
29
G
77
Posts: 5,188
Reputation: 54,281


Return to How do I....?

Who is online

Users browsing this forum: Ajbael, Pulstar and 9 guests