Swimming

Get help using Construct 2

Post » Sat Jul 18, 2015 12:28 pm

We've all played Mario, right?

Well, you know how when you go into the water and you're able to swim by constantly pressing the jump button?
I'm looking for a way to do that.

So, I need to know how I can make the player go into a body of water and be able to comfortably swim by jumping over and over again.
If you don't know what I'm talking about, take this link to a video of Mario swimming!

https://www.youtube.com/watch?v=cShgY-2C20s

Thanks in advance!
B
24
S
10
G
1
Posts: 153
Reputation: 2,660

Post » Sat Jul 18, 2015 12:53 pm

Something like this?

player is overlapping water
on jump pressed
> swim
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Jul 19, 2015 2:19 am

">Swim" ?

How do I do that
B
24
S
10
G
1
Posts: 153
Reputation: 2,660

Post » Mon Jul 20, 2015 12:46 am

Bump! I would really appreciate the help ^-^
B
24
S
10
G
1
Posts: 153
Reputation: 2,660

Post » Mon Jul 20, 2015 7:04 am

Swimming is not one of the actions provided, so you would have to make your own..

Create a swimming animation
Decide what you want the swimming to look like
make actions based on that..

For example you could switch to 8 direction behaviour when overlapping the water..
just add the animations and you are done..
But you'd probably want more control over the swimming part, which would consist of adding more canditions and attached actions..

You might want to try searching the forum for earlier examples..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Jul 20, 2015 7:12 am

Like I said up there ^ I want the player to be able to swim by only pressing the jump button. I even provided a link.

I already have the animations, it's not that I need help with. I need to know how to make it so that everytime you press the jump button, you go up a bit. Just like in the link I put in the original post.
B
24
S
10
G
1
Posts: 153
Reputation: 2,660

Post » Mon Jul 20, 2015 7:31 am

So you'd have to create actions for "going up a bit"

I guess setting the platformer jump strength and maximum fall speed while overlapping would get you more than halfway there..

Instead of changing the jump strength you could also choose to use "platform set vector x" and "platform set vector Y"
Last edited by LittleStain on Mon Jul 20, 2015 7:35 am, edited 1 time in total.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Jul 20, 2015 7:35 am

Switching to a different movement behavior may be easier for you, or doing your own custom platformer controls instead of the Platformer behavior. The other option is to generate an invisible platform just below your player's feet when you press the jump key in water. That way you can continue to keep jumping as many times as you want. You probably also want to reduce gravity, acceleration, maximum speed, and jump strength while in water to give it the right feel.
B
10
S
2
Posts: 33
Reputation: 710

Post » Mon Jul 20, 2015 7:49 am

I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sat Jul 25, 2015 9:12 am

Works perfectly, thanks LittleStain!
B
24
S
10
G
1
Posts: 153
Reputation: 2,660


Return to How do I....?

Who is online

Users browsing this forum: DiabloOvermind and 10 guests