Example #1
0
 public void HideAndWaitForNextSpawn()
 {
     this.Visible  = false;
     this.Velocity = Vector2.Zero;
     this.Position = DefaultPosition;
     r_RandomSpawnRoller.Activate();
 }
Example #2
0
        public Mothership(Game i_Game) : base(k_AssetName, i_Game)
        {
            this.TintColor = Color.Red;
            this.Velocity  = Vector2.Zero;
            this.Visible   = false;
            PointsValue    = k_MotherShipPointsValue;

            r_RandomSpawnRoller = new RandomRoller(i_Game, k_ChanceToSpawn, k_TimeBetweenRolls);
            r_RandomSpawnRoller.RollSucceeded += SpawnAndFly;
            r_RandomSpawnRoller.Activate();
        }
Example #3
0
        public Invader(
            Game i_Game,
            Color i_Tint,
            int i_PointsValue,
            int i_ColIndexInSpriteSheet,
            int i_RowIndexInSpriteSheet)
            : base(k_InvadersSpriteSheet, i_Game)
        {
            TintColor               = i_Tint;
            PointsValue             = i_PointsValue;
            m_ColIndexInSpriteSheet = i_ColIndexInSpriteSheet;
            m_RowIndexInSpriteSheet = i_RowIndexInSpriteSheet;
            r_Gun = new Gun(this, k_MaxBulletsInScreen);

            r_TimeBetweenRollingForShootInSeconds = RandomGenerator.Instance.NextFloat(k_MinTimeBetweenShootRolls, k_MaxTimeBetweenShootRolls);
            r_RandomShootRoller = new RandomRoller(i_Game, m_ChanceToShoot, r_TimeBetweenRollingForShootInSeconds);
            r_RandomShootRoller.RollSucceeded += Shoot;
            r_RandomShootRoller.Activate();
        }