public static void DrawBullets(Wepon wepon, Graphics graphics) { if (wepon != null) { var bulletDrawer = new BulletDrawer(); foreach (var bullet in wepon.Bullets) { bulletDrawer.Draw(bullet, graphics); } } }
public bool IsBulletDestroydAndMove(Wepon wepon, Level level) { if (BulletDirection == MoveType.Left) { Location = new Point(Location.X - Config.BulletSpeed, Location.Y); } else { Location = new Point(Location.X + Config.BulletSpeed, Location.Y); } if (IsBulletHitSomething(level)) { wepon.Bullets.Remove(this); return(true); } return(false); }
public void SetWepon(Level level) { PlayerWepon = new Wepon(level); }