How do I make projectiles follow a curve or line?

0 favourites
  • 3 posts
From the Asset Store
solution for games like "fruit ninja" and drawing applications
  • Hey! i wanna make a schmup game.

    I have few questions, how do you spawn multiple projectiles at different waypoints ?

    And, is it possible to create a sprite like a curve, and make the projectile follow the line to A to point B at the end of it ? thx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I am not entirely sure what you are asking, but I will try to answer and see if it helps. To spawn projectiles at different points in your map, you could use the turret behavior and have damaging sprites as the projectiles. When the shooters are destroyed, simply either destroy the sprite with the behavior or disable the behavior (I would recommend the first one, unless you want the shooter to be resurrectable). To have the projectile move in a curve from point A to point B... well, if you mean what I think you mean, like a boomerang thrower's boomerangs from BTD5, then the best approach that I could think of would be to set the turret behavior's projectile speed to 0 (it might not go to 0 quite, then just do something like 0.01 (or you could manually implement the behavior with events/scripts)), and then apply the orbit property to every projectile as soon as it is created, and have the orbit point be halfway (I think?) between the shooter and the target. If it hits its target, or goes past a certain point, then destroy the projectile instance. It will likely start behind or in front of the shooter, be weirdly centered, or too tight/loose. To fix this, you will need to use some math to modify the orbit parameters, a lot of which has to be done in realtime using events/scripts.

  • I am not smart enough to be able to give you the math, but you could probably look it up somewhere or ask someone who has skill if you do not know it. In the worst-case-scenario, you could use trial-and-error.

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