How do I Flip Players Behaviour?

Get help using Construct 2

Post » Thu Mar 19, 2015 3:48 am

Okay so this part of the game has stopped me in my tracks. Let me explain what the game is............
The game is a play who is stood on a moving platform. The platform is thin (30pixels) and is positioned in the centre of the screen. Therefore both the top and bottom of the platform are visible.

There are enemies spawning from the right heading towards the player on the left. The player has to jump over these enemies as they come towards him.

There is a flip button which allows the the player to flip to the underside of the platform avoiding the enemies on the top. The bottom platform also has enemies coming towards him.

THE PROBLEM: The problem i am having is that when a player has a platform behaviour he continues to fall until he lands on a solid object. How do i make it so that when the player flips to the underside of the platform he doesn't fall and that when he jumps it will be -100 in strength for example and he will essentially jump DOWN as opposed to UP???

Sorry it was so drawn out. I have tried attaching an image example of what i mean to make it more understanding
You do not have the required permissions to view the files attached to this post.
B
8
S
2
Posts: 146
Reputation: 1,132

Post » Thu Mar 19, 2015 4:04 am

Set a negative value to Gravity in Platform Behavior.
Image
B
16
S
7
Posts: 126
Reputation: 1,920

Post » Thu Mar 19, 2015 4:16 am

Yeah i managed to do that but how do i set the position of the player to under the platform without the player falling due to its 'platform' behaviour, and repeat the flipping process every time the ''flip'' button is pressed????
B
8
S
2
Posts: 146
Reputation: 1,132

Post » Thu Mar 19, 2015 4:19 am

If the platform is fixed, just Set Y.
Image
B
16
S
7
Posts: 126
Reputation: 1,920

Post » Thu Mar 19, 2015 4:27 am

I know I probably sound stupid haha but what do you mean? How should I code it?
B
8
S
2
Posts: 146
Reputation: 1,132

Post » Thu Mar 19, 2015 6:01 am

You won't be using the platform behavior for the flip. Disable it and reenable once the player is flipped. You can create smooth motion using this: https://www.scirra.com/tutorials/378/cr ... -with-lerp. You might also do some funny things with the height of the player's sprite to make it look better. The position you are trying to move the player toward is Platform.Y - <Player's Height>. You probably don't want to change the player's X.

If you just want to move the player without getting fancy, sprite has a Set Position action.
B
14
S
5
G
1
Posts: 189
Reputation: 1,536

Post » Thu Mar 19, 2015 6:24 am

Do you want to do this?
You do not have the required permissions to view the files attached to this post.
Image
B
16
S
7
Posts: 126
Reputation: 1,920

Post » Thu Mar 19, 2015 7:41 pm

@bladedpenguin I was confused by the Lerp thing. I couldn't find the capx to download?

@EstudioCelula3 is it possible to screenshot the event page? I have an older version and had a few problems downloading the newer version.
B
8
S
2
Posts: 146
Reputation: 1,132

Post » Thu Mar 19, 2015 9:47 pm

Hmm I PM'd the author of the tut. Hopefully he responds and updates his links.

You should still be able to move the Player with Set Position, it'll just be instant instead of smooth.
B
14
S
5
G
1
Posts: 189
Reputation: 1,536

Post » Fri Mar 20, 2015 12:33 am

thanks so much. Yeah instant is fine :)
B
8
S
2
Posts: 146
Reputation: 1,132

Next

Return to How do I....?

Who is online

Users browsing this forum: brunopalermo and 23 guests