0 Favourites

Rocket jumping & what I'm not getting

This forum is currently in read-only mode.
  • Here's a small problem I'm fairly confident could be solved in an instant and that'll leave me feeling really dumb staring at the obvious answer. Anyways,

    I wish to create a platformer that allows rocket jumping, this meaning that when the Player fires a projectile at his feet the ensuing explosion propels the character backwards to the opposite direction. As Construct's behaviour mechanics are fairly versatile I'm quite confident it could be done in just a few events with the platform behaviour.

    I've got a .cap here. It contains a layout with a simple room and a player character. Left clicking fires a rocket, and when said rocket hits a wall it creates an explosion and also a sort-of blastwave. The latter is an object with a bullet behaviour, set to target the player. When this object hits the player it sends him flying through the air in the same angle... Or that's what should happen, problem being I don't know how exactly this could be achieved. I guess it could be done with the action "set X, Y component of motion" in the player's platform behaviour but I have no idea how to calculate the angle or force for this.

    Download the cap here: http://www.sendspace.com/file/3ppxl9

    I know this is possibly the simplest stuff but man if I'm not having a hard time with it. Can this even be done with just the platform behaviour or do I have to set up a custom movement of sorts? Help me out!

  • Here you go quick example.


    Oh you'll need the latest unstable version form HERE.

    Hope that helps.

  • Could also set the speeds to the playerdude's current speed + the force speed if you want to be able to boost normal jumps or running speeds.

    You can also set ratios by adding multipliers, like the 0.85 below. This would limit higher combined total speeds, so that the resulting speeds are closer together between a standing and jumping boost.

    + Force: Force overlaps ForceDetector -> PlayerDude: Set horizontal speed to PlayerDude

    [Platform].VectorX * 0.85 + Force[Bullet].VectorX * 10

    -> PlayerDude: Set vertical speed to PlayerDude[Platform].VectorY * 0.85 + Force[Bullet].VectorY * 10

    One consideration if you increment the speed instead of setting it to a static speed is the 'overlaps' condition used. Depending upon the settings used, this could be true for several ticks, causing the playerdude to keep increasing speed and rocket away. In that case, you may want to switch to 'on collision'. Or not.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Well whaddayouknow, I AM feeling pretty dumb right now! Thank you both!

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