How to: Artillery physics power and angle?

0 favourites
  • 7 posts
From the Asset Store
Sheeky's Power-ups Sounds
$4.20 USD
30% off
75 power-up sound effects; bonus and notification sounds, fanfares, harp glissandi, stabs, clock ticks, etc.
  • In terms of an artillery game what function / formula should I use to supply the "Impulse" and "Angle" for the 'Apply impulse at angle' function. Given that I know the distance between the launch point and the target?

    Can I adjust the power and angle values to increase or decrease the projectiles flight time given a fixed horizontal distance? (Make the projectiles peak at higher or lower points in world space!)

    So, what is the function that allows me to pass 'time' and 'distance' and have it return 'power' (impulse) and 'angle'?

    Cheers

    Juba.

  • For angle, you have the system expression angle(x1,y1,x2,y2) which will return an angle.

    As for a formula I'm not math savy enough to provide one.

    I'd go for trial and error, trying to find a ratio between, like you said, time and distance.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I am a bit mysitified, but This site looks like exactly what you want.

  • There's not, you don't even want to use physics for that kind of stuff.

    If you have a start point and an end point you just want to calculate a curve.

    Physic is usefull if you want a movement to be the consequence of environnemental factor (gravity, wind, friction) Thus you can't really predict movement, and you don't really want to.

    The behavior you describe is really not physics driven.

    Indeed what squid showed is a curve calculation you can use the bullet behavior and tweak angle/speed during movement

  • Thanks guys.

    I think ill have to post the game Im working on in c2 for you to see why I'm asking for a physics based solution. Its not a standard artillery game its an action side scrolling game. Ill post it eventually i

    I was thinking about using curves instead. I guess as all games designers know its just smoking mirrors.

  • Another questions gravity on earth is 9.8m/s^2 so say I I change the world gravity in C2 to 30 would that just mean 30.0m/s^2??

  • I think 30px/s�

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