Sean @ Sat Apr 26, 2008 11:55 am wrote:
Pretty simple, you draw your gun and then use a for loop to move the bullet in a certain direction.
No no no, do not use a for loop. Instead remember the bullet's angle and velocity. Using basic trig you make the bullet travel in that angle at that velocity each frame. For efficiency have velX and velY (x and y components of the velocity in relation to the angle) precomputed and just add this to you x and y coordinates. Having types will be useful. Make a type called bullet. It should store the x and ycoordinate and the xVel and yVel. Then you can make a flexible array of bullets.