- #1
Jaeya
- 3
- 0
Hi, firstly, sorry about my bad english... I am an Spanish preuniversitary student who's programing a game in the style of "Worms" in 2D.
My problem comes about a weapon that acts like a missile. I'll explain it (it's just an cinematic study, the game doesn't care about mass and dynamics).
The weapon is a mobile object. There are three accelerations acting over it:
- The constant acceleration of gravity, directed to "down" which value is g.
- The constant acceleration of wind, directed to "right", which value is w.
- The acceleration of the engine of the missile, which magnitude is p. The direction of this acceleration is variable: the missile accelerates in the same direction of its velocity. In consequence, the equations of this accelerations will be something like this:
a_x = w + p cos #
a_y = g + p sen #
where # is the angle of the direction of the missile.
If we look on that cos # = dv_x / dv , sen # = dv_y / dv , the equations will be:
a_x = w + p (dv_x / dv)
a_y = g + p (dv_y / dv)
My question is, how can I change this differential equations into parametric equations depending on time? I mean, x=f(t), y=g(t)
The movement will have an initial velocity, v_x0, v_y0; and you can supose the movement begins in x=0, y=0.
Thanks in advance! :)
My problem comes about a weapon that acts like a missile. I'll explain it (it's just an cinematic study, the game doesn't care about mass and dynamics).
The weapon is a mobile object. There are three accelerations acting over it:
- The constant acceleration of gravity, directed to "down" which value is g.
- The constant acceleration of wind, directed to "right", which value is w.
- The acceleration of the engine of the missile, which magnitude is p. The direction of this acceleration is variable: the missile accelerates in the same direction of its velocity. In consequence, the equations of this accelerations will be something like this:
a_x = w + p cos #
a_y = g + p sen #
where # is the angle of the direction of the missile.
If we look on that cos # = dv_x / dv , sen # = dv_y / dv , the equations will be:
a_x = w + p (dv_x / dv)
a_y = g + p (dv_y / dv)
My question is, how can I change this differential equations into parametric equations depending on time? I mean, x=f(t), y=g(t)
The movement will have an initial velocity, v_x0, v_y0; and you can supose the movement begins in x=0, y=0.
Thanks in advance! :)