Example #1
0
 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);
         }
     }
 }
Example #2
0
        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);
        }
Example #3
0
 public void SetWepon(Level level)
 {
     PlayerWepon = new Wepon(level);
 }