Exemple #1
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();
        }
Exemple #2
0
        private static void Main()
        {
            IRoller        roller = new RandomRoller();
            IWriter        writer = new ConsoleWriter();
            IIndicesReader reader = new IndicesReader(writer, new ConsoleReader());

            IPlayer player = new Player(roller, reader, writer);

            while (player.HasMoney())
            {
                player.MakeBet();
                player.InitialRoll();
                player.FinalRoll();
                player.ComputeHand();

                Console.WriteLine();
            }
        }
Exemple #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();
        }