I'm working on a Breakout game, and want to change the ball's movement code from how I currently do it, to something based on vectors (as I feel learning and implementing movement based on vectors will help me in the long run).
Currently I am doing something like this (Pseudocode):
if(ball.Y < HEIGHT)
ball.Y += 1; // I actually save a direction as well,
//and multiply this by the direction (1 or -1)
else
ball.Y -= 1;
if(ball.X < WIDTH)
ball.X += 1;
else
ball.X -=1;
Anyway, you get the gist of it. My current code is actually much more verbose, but handles collisions well. Basically I am just using screen coordinates, and I find that this is probably not the best way to be doing this.
How would you implement a more correct, extensible (to other projects), way to move objects?
EDIT: I am not looking to use a 2D Vector library; more-so I am looking for an explanation of how vectors are used for movement in games, and how I can implement them myself.