swimming?

Get help using Construct 2

Post » Mon Aug 26, 2013 1:13 am

So I got my character to swim. Once he hits the water, his behavior changes to 8 direction. but the thing is, I want the character to jump "out" of the water when he's overlapping the top edge of the water. Get what i'm puttin' down?
B
10
S
4
G
1
Posts: 159
Reputation: 1,933

Post » Mon Aug 26, 2013 2:18 am

I kinda do. Hmm... how to do this...

*Clickity click click*

I don't have a way to share my demo (My computer doesn't like Dropbox apparently.) BUT you can do something that changes your character from 8 Direction mode (New band name idea! ^.^) back into Platformer mode once he leaves the water, either by overlap detect or collision detect with an object on the surface. I'd go with the object on the surface so it uses less power and performance. I'd then use a bit of code that translates to this: "On collision with surface, [INSERT whatever you did to flip the switch between platformer and 8Direction here] and adjust Vector Y to 300" or something.


...Does any of that make sense? I can tell it's a lot of words.
B
5
S
1
Posts: 22
Reputation: 569

Post » Mon Aug 26, 2013 2:26 am

I actually did do that (switch from platformer to 8direction then back again) But the problem I had was when I would HIT the water, the character would spaz out for a second, then stop and kind of act in 8 direction.
B
10
S
4
G
1
Posts: 159
Reputation: 1,933

Post » Mon Aug 26, 2013 6:41 am

I'd get rid of the 8 Direction control all together.

Instead set the fall speed of the character to 1/4 when in water making them fall slower. You can change movement speed and jump strength too.

Simply change them back when your not overlapping water.

This means you will sink if you aren't "jumping"

Encase jumping doesn't work because you're not touching a platform simply making a condition, if overlapping water and pressing jump simulate control jump.

Also, if you want special attributes when at the surface of the water you can have a condition

If Player.BBoxTop is Higher than Water.BBoxTop allow for extra jump or anything else. (It just checks that the player is above the water line)

Hope this helps and makes sense.

From ShaunRemo
B
5
S
2
Posts: 6
Reputation: 646

Post » Mon Aug 26, 2013 2:34 pm

How would I make him swim like Donkey kong in Donkey kong country?
B
10
S
4
G
1
Posts: 159
Reputation: 1,933

Post » Mon Aug 26, 2013 5:42 pm

If I understood the video I looked up right (haven't played it) that looks about right. He has to constantly "jump" up in order to stay afloat, right? Or does he not sink if you don't press any buttons? If you don't want him to sink, you can add to the "on contact with water" code so it adjusts the gravity too.
B
5
S
1
Posts: 22
Reputation: 569

Post » Tue Aug 27, 2013 3:55 am

Forget my previous post. But any control scheme should work so long as you completely turn off the "dry" mode once he hits the water. If it's not too hard, I might try something like this myself and go with a method for changing character/objects completely.
B
5
S
1
Posts: 22
Reputation: 569


Return to How do I....?

Who is online

Users browsing this forum: minigame and 8 guests