Example #1
0
 internal void Initialize()
 {
     mass          = 32f;
     playing       = false;
     radius        = 20f;
     shieldPolygon = VectorPolygon.CreateCircle(Vector2.Zero, 20f, 16);
 }
Example #2
0
        /// <summary>
        /// Construct a new ship, for the given player.
        /// </summary>
        /// <param name="world">The world that this ship belongs to.</param>
        /// <param name="playerIndex">
        /// The Gamepad player index that controls this ship.
        /// </param>
        public Ship(World world, PlayerIndex playerIndex)
            : base(world)
        {
            this.playerIndex = playerIndex;

            this.radius        = 20f;
            this.mass          = 32f;
            this.color         = shipColorsByPlayerIndex[(int)this.playerIndex];
            this.polygon       = VectorPolygon.CreatePlayer();
            this.shieldPolygon = VectorPolygon.CreateCircle(Vector2.Zero, 20f, 16);
        }
Example #3
0
 /// <summary>
 /// Constructs a new power-up.
 /// </summary>
 /// <param name="world">The world that this power-up belongs to.</param>
 public PowerUp(World world) : base(world)
 {
     this.mass         = 500f;
     this.polygon      = VectorPolygon.CreateCircle(Vector2.Zero, 16f, 16);
     this.innerPolygon = VectorPolygon.CreateCircle(Vector2.Zero, 10f, 16);
 }