# Defining the movement of an object on a 2-dimensional plane

I am trying to define the movement of an object for a danmaku game I am making. Here is a link to some example gameplay (not my game, but a popular series in this genre made by Zun). Basically, I was thinking that any object's movement (in a 2-dimensional plane) can be defined using just two functions. This is a 2d game and so there are two axes. It will have a velocity in pixels/secs for the x-axis and for the y-axis with positive numbers being velocity going right for the x-axis and going up for the y-axis. I was thinking that no matter how complex the pattern of the object, I can define it using two functions. Maybe it isn't practical to define their movement this way, but I was wondering if it is theoretically possible.

I hope that my question was explained clearly enough. Also, if you know of any books that deal with this sort of thing that would be nice to know about as well. I also did not now what tags to put on this so some of these may be wrong.

-
That seems like the standard way of doing it. Anyways, it would certainly seem like it's the way done in Touhou. See this link. – EuYu Nov 3 '12 at 4:34
Thank you EuYu. That link was very helpful. It seems that they use velocity and direction instead of a velocity for the x and y axes but it seems accomplish the same thing. Maybe doing it with direction and velocity is easier though? – russjohnson09 Nov 3 '12 at 5:01
They use a Hermite spline curve for some reason. I have no idea of the actual reason, but perhaps direction/velocity is more compatible for the bullet patterns generated. – EuYu Nov 3 '12 at 5:06

In other words, if $x(t_0) = x_0$, what is $x(t_0 + \Delta t)$, where $\Delta t$ is the time between frames? If you know the velocity $v_x(t_0)$, then a simple approach is to say $x(t_0 + \Delta t) = x_0 + v_x(t_0) \Delta t$. This is the Euler method, and it's simple, but not terribly accurate. Better methods include the whole class of Runge-Kutta methods for numerical integration, but they may be more advanced than the situation requires.