How do I propel the player in the opposite direction they fired a bullet?

0 favourites
  • 4 posts
From the Asset Store
Basic Rounded Vector Geometry Player Design with Glow for 3 player games
  • Hi there! I'm making a platformer game with the Player using Platform movement. I've set up a bullet system where holding down left mouse fires a stream of bullets which is imitating a stream of water. I want that stream to be able to propel the player against gravity when it collides with the ground like a strong jetstream (or in the opposite direction if it is against a wall) but I can't figure out how to translate the bullet collision to Player movement in this way.

    I'm super new to Construct but I have read a ton of the manual, tried to search for an answer etc to no avail. If anyone can point me in the right direction I would really appreciate it. Thanks!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You could try adding a vector in the negative y-axis to your player once the bullet collides.

  • Thanks for the replies!

    dop2000, unfortunately immediate knockback wasn't what I was trying to achieve as it needed to be on bullet collision and not bullet fire, and I needed it to be 360 degree movement, not just left and right. Thanks though!

    dieclick, took me a while to get my head around it but you were right! I managed to get a passable effect working by using:

    with the blue box being my bullets, which continuously spawn when left click is held and destroy after travelling a certain distance. My player box is 64x64 for scale. I was missing the vector X & Y to actually get off the ground (also found that halving the gravity for the fall made it feel better too).

    It's still got some bugs I need to iron out but I'm 90% of the way there. Thanks for all your help!

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