Our asteroid game from chapter 7 was functional but not that challenging. In order to make it more interesting, we need the asteroids to actually move! And, to give the player a chance to avoid the moving asteroids, we need to make it possible to move and steer the spaceship as well.
To implement motion in the asteroid game, we’ll use many of the same calculus concepts from chapter 8. The numerical quantities we’ll consider are the x and the y positions of the asteroids and of the spaceship. If we want the asteroids to move, these values are different at different points in time, so we can consider them to be functions of time: x(t) and y(t). The derivative of a position function with respect to time is called velocity, and the derivative of velocity with respect to time is called acceleration. Because we have two position functions, we have two velocity functions and two acceleration functions. This allows us to think of velocities and accelerations as vectors, as well.