示例#1
0
 public TankShip(Point2D position)
 {
     Mover           = new MovingBehavior(this);
     Type            = FlyingObjectType.Tank;
     HorizontalSpeed = -Speed;
     VerticalSpeed   = 0;
     HealthPoints    = mHealthPoints;
     Brush           = mBrush;
     base.Size       = Size;
     Position        = position;
 }
示例#2
0
文件: Bullet.cs 项目: valekkp/Games
 public Bullet(FlyingObject source)
 {
     Mover           = new MovingBehavior(this);
     HorizontalSpeed = source is PlayerShip ? Speed : -Speed;
     Type            = source is PlayerShip ? FlyingObjectType.PlayerBullet : FlyingObjectType.EnemyBullet;
     HealthPoints    = mHealthPoints;
     base.Size       = Size;
     Brush           = source is PlayerShip ? mPlayerBrush : mEnemyBrush;
     Position        = source is PlayerShip
         ? new Point2D(source.Position.X + source.Size.Width / 2 + Size.Width / 2, source.Position.Y)
         : new Point2D(source.Position.X - source.Size.Width / 2 - Size.Width / 2, source.Position.Y);
 }
示例#3
0
        public Meteorite(Point2D position)
        {
            Mover           = new MovingBehavior(this);
            Type            = FlyingObjectType.Meteorite;
            HorizontalSpeed = -Speed;
            VerticalSpeed   = Speed;
            HealthPoints    = mHealthPoints;
            Brush           = mBrush;
            int diameter = random.Next(70, 111);

            Size     = new Size(diameter, diameter);
            Position = position;
        }