I currently have a very basic shooter. The problem is that the bullet's just skip pixels, like programmed.
I have a picture. the thing is the picture could be a video. If I hold the trigger down that is what I see. The pattern never breaks, unless I move reticle, then it starts again. Right now my 'bullets' simply change their position, so they skip some spots, and then the collision detection is messed up to.
The code is below. I guess the code isn't really important, I know how it's working. What I want to know is how do I make them look good as if they go through each pixel or however you want to put it(animations?) and if there is a good sample.
| public void fireProjectile(Vector2 loc) |
| { |
| foreach (projectile ball in bullets) |
| { |
| if (!ball.alive) |
| { |
| ball.alive = true; |
| ball.position = loc; |
| ball.velocity = new Vector2( |
| (float)Math.Cos(firstPlayer.angle), |
| (float)Math.Sin(firstPlayer.angle)) * 15f; |
| return; |
| } |
| } |
| } |