I try to make shooter game on C# with SFML.NET, but I can`t imagine how to make an ability to shoot more than 1 bullet, because now I have just one null-object of bullet-class, and when player presses Space key this object gets link to the new bullet.
So, I have the Bullet-class, null-object
public static Bullet bullet = null;
and condition
if (Keyboard.IsKeyPressed(Keyboard.Key.Space))
{
if(bullet == null)
bullet = new Bullet(t, p.rect.Left, p.rect.Top, p.reverse);
}
When bullet reaches the wall or enemy bullet object gets equated to null. The problem is to make ability to shoot more bullets before this bullet reaches the wall or enemy (and disappear). I think this is not a good solution to make null-objects for every possible pullet, because then we have limited amount of possible bullets.