Water Direction Move Resistance

0 favourites
  • 8 posts
From the Asset Store
16 Direction Capx
$3 USD
40% off
Rotate & Animation for 16 Direction & Mouse Direction
  • Hello Guys! First post here.

    I'm working on a project, a game about viruses and the cardio vascular system. Essentially, I'm trying to mimic a current like effect for the blood vessels that push the player and other entities either away to the heart or into the heart.

    To illustrate this I have included a very rough graphic to show the idea

    Issue is, I don't know how to go about doing this, so I'm hoping one of you know how or can point me in the right direction to do this.

    Thanks!

    Jordan.

  • Are you using Physics behavior for player movement? You can apply a force when player overlaps blood vessels. For example, you can add an instance variable CurrentDirection, and use "Apply Force 100 at angle BloodVessel.CurrentDirection"

  • Are you using Physics behavior for player movement? You can apply a force when player overlaps blood vessels. For example, you can add an instance variable CurrentDirection, and use "Apply Force 100 at angle BloodVessel.CurrentDirection"

    I haven't actually played around with the physics too much as I'm still in the design phase but I will definitely give what you said a go, much appreciated!

  • You put "physics" as tags to this post, that's why I assumed you are using this behavior. If you are using other behaviors (Platform, 8-direction etc.), the solution will be different.

  • You put "physics" as tags to this post, that's why I assumed you are using this behavior. If you are using other behaviors (Platform, 8-direction etc.), the solution will be different.

    Sorry, still learning Construct and only now have seen there is a physics behaviour, so I will have a play with that! Right now I'm using 8-direction.

  • With 8-direction it's a bit more difficult. You can move the character slightly up or down by directly changing its Y coordinate on every tick, for example:

    Character overlapping Vessel
     Character set Y to self.Y-20*dt
    

    However, this can mess with collision detection in 8-direction behavior. If there are solid walls or corners, your character may get stuck or shake.

    The proper way of doing this is by using 8-direction actions - "Set max speed" or "Set Y vector". For example, when the character moves in the direction of the water flow, you need to increase behavior max speed. When it moved against it, decrease the max speed.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • With 8-direction it's a bit more difficult. You can move the character slightly up or down by directly changing its Y coordinate on every tick, for example:

    > Character overlapping Vessel
    Character set Y to self.Y-20*dt
    

    However, this can mess with collision detection in 8-direction behavior. If there are solid walls or corners, your character may get stuck or shake.

    The proper way of doing this is by using 8-direction actions - "Set max speed" or "Set Y vector". For example, when the character moves in the direction of the water flow, you need to increase behavior max speed. When it moved against it, decrease the max speed.

    I think the set max speed will be the best option and from working it achieves most of the desired effect. The overall aim of the game is for the player to get to the heart, so if they go through vessels leading away from the heart (such as to avoid a hazard) then it will add a movement penalty like you suggested. Great idea! Appreciate the simple solution.

  • Also, sorry for tpyos/bad english it's nearly 6am and haven't slept haha

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