Exemple #1
0
        public MotherShip(SpeccyEngine speccy, int firstRow)
        {
            _speccy   = speccy;
            _firstRow = firstRow;

            Bombs = new EnemyBomb[10];

            Initialise();
        }
Exemple #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Bomb" /> class.
 /// </summary>
 /// <param name="speccyEngine">The speccy engine.</param>
 /// <param name="crateMap">The crate map.</param>
 /// <param name="row">The row.</param>
 /// <param name="col">The col.</param>
 public Bomb(
     SpeccyEngine speccyEngine,
     bool[,] crateMap,
     int row,
     int col)
 {
     _speccyEngine   = speccyEngine;
     _crateMap       = crateMap;
     _row            = row;
     _col            = col;
     _detonationTime = DateTime.Now.AddSeconds(6);
 }
        /// <summary>
        /// Gets a random colour.
        /// </summary>
        /// <param name="se">The se.</param>
        /// <param name="includeBlack">If false, this will never return Black.</param>
        /// <returns></returns>
        public static Color GetRandomColour(this SpeccyEngine se, bool includeBlack = false)
        {
            Color colour;

            var rnd = new Random();

            do
            {
                colour = se.SpectrumColours[rnd.Next(se.SpectrumColours.Length)];
            } while (colour == Colors.Black);

            return(colour);
        }
Exemple #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SecurityGuard" /> class.
        /// </summary>
        /// <param name="speccyEngine">The speccy engine.</param>
        /// <param name="row">The row.</param>
        /// <param name="col">The col.</param>
        /// <param name="map">The map.</param>
        public SecurityGuard(
            SpeccyEngine speccyEngine,
            int row,
            int col,
            bool[,] map)
        {
            _speccyEngine = speccyEngine;
            _map          = map;
            Row           = row;
            Col           = col;

            _mazeSolver = new AStarMazeSolver(map, timeoutMs: 10);
        }
Exemple #5
0
 public PlayerMissile(SpeccyEngine speccy, int row, int col)
 {
     _speccy = speccy;
     Col     = col;
     Row     = row;
 }
Exemple #6
0
 public ForceField(SpeccyEngine speccy, int row)
 {
     _speccy = speccy;
     _row    = row;
     Initialise();
 }
        /// <summary>
        /// Prints a line of text centred on the screen.
        /// </summary>
        /// <param name="se">The se.</param>
        /// <param name="row">The row.</param>
        /// <param name="text">The text.</param>
        public static void PrintCentre(this SpeccyEngine se, int row, string text)
        {
            var col = (SpeccyEngine.ScreenCols - text.Length) / 2;

            se.Print(row, col, text);
        }
Exemple #8
0
 public EnemyBomb(SpeccyEngine speccy, int row, int col)
 {
     _speccy = speccy;
     Col     = col;
     Row     = row;
 }
Exemple #9
0
 public PlayerShip(SpeccyEngine speccy, int row)
 {
     _speccy = speccy;
     _row    = row;
     Col     = 30;
 }