Swimming

This forum is currently in read-only mode.
  • So i have been trying to make swimming in my game, where instead of slowly sinking all the time, you float, and have to actively make yourself sink.

    There are various options i have found that almost facilitate this.

    I have it set at the moment, so that when you over lap the water detector thing, it changes the gravity direction, but this however rotates all the controls 180. So then i have it invert the controls. But invert doesn't change the jump direction. Which kills the effect.

    I have tried setting gravity to a negative value, but that does not work.

    Is there anyway to invert the jump direction? Or can anyone think of a better way to do floating in water?

  • I think you what swimming like super Mario world.

    anyway here is a cap to show you how to do it.

    http://download953.mediafire.com/zsil2w ... imming.cap

    just press X key to jump and swim up.

    hope this help you out.

  • Very slick demo toralord

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I think you what swimming like super Mario world.

    anyway here is a cap to show you how to do it.

    http://download953.mediafire.com/zsil2w ... imming.cap

    just press X key to jump and swim up.

    hope this help you out.

    believe he wanted to actively swim downward... floating until the user presses button X.

  • I'd suggest making it a form of a reverse jump (though not reversing gravity)

    When the character is in water, move him upwards constantly unless he is at the surface, and when the player presses [whatever], move him downwards again. Either make the downwards movement stronger than the constant upwards movement or disable the upwards movement while the character is diving.

    Alternatively, you could make the swimming controls be 8 directional movement instead.

    -Player is in water

    -Player control "swimbtn" is down

    ----+Deactivate Platform behaviour

    ----+Activate 8 Direction behaviour

    and of course move him upwards whenever he's in water and not holding "swimbtn" down.

  • I represent you the ultra realistic water dynamics:

    http://www.box.net/shared/u4qbeqqeap

    By modifying players [Platform].VectorY movement you can get that soft movement you might want. I would probably use some detectors on the surface or some else way control that player doesn't accelerate too much when he's going upwards.

  • Hey thanks guys

    I have not been idle, and have come up with 4 or 5 different methods that almost get what i want, the closest one is so, so, so close, but a weird bug pops up in one place.

    I don't know how much time i have this weekend. I am working the whole public holiday weekend, and my parents will be in town. But i will be trying to incorporate what you chaps have suggested so far, and see if i can come up with something comprehensive.

    SacceuS - Hey chap, very close to what i want, thanks! Where did you get this "Player[Platform].VectorY" from? I have not come across this in my travels.

    InkBot - Very good ideas, one of my solutions was 8 direction, but not as elegant as you proposed. I will have to look into that aswell.

    Partymetroid - Cheers for bringing that up, didn't want to rag on the only guy to offer help so far :/

    Guyon - True!

    Toralord - Cheers for the example man, unfortunately that is the sort of swimming i already have involved, want to reverse the situation!

    Thanks guys, if i get anything going i will endeavour to make it tidy enough to post. I went to bed quite pissed off that i had not managed to succeed with this, especially with no real time to work on it coming up for a week or so. Was good to find some help this morning.

  • My bad I think I get what you are talking about.

    So, player is floating on the surface, and have to actively make yourself sink and rise.

    I made a new cap to show the kind of swimming you want.

    http://download717.mediafire.com/nzy0jq ... ming+2.cap

    Now the key controls are different then the my last cap.

    When you are on land the platform behavior is normal.

    press the X key to jump

    press the arrow keys to move

    when you are in the water the platform behavior changes.

    Pressing the X key to jump will only work in the water when the player is at the top or the bottom of the water.

    press the arrow keys to swim around.

    P.S. I also made a reverse one to the one on top.

    http://download277.mediafire.com/y0ibwm ... ming+3.cap

    In this one the player always float up while in the water.

    press the X key to jump while in water only work when at the top of the the water again.

    press the left and right arrow keys to move

    press the down arrow key to dive.

  • Is there a way to move it to Construct2?

  • You can't just copy paste from CC to C2, but the events are simple enough to recreate.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)