Beispiel #1
0
        public RacerGame(ConsoleHardwareConfig config)
            : base(config)
        {
            _screens = new Screens(this);

            DisplayDelay = 25;
        }
Beispiel #2
0
 public GameOfPong(ConsoleHardwareConfig config) : base(config)
 {
     World          = new Composition(new byte[] { 0, 0, 0, 0, 0, 0, 0, 0 }, ScreenSize, ScreenSize);
     Ball           = new PlayerMissile("ball", 0, 0, World);
     LeftPaddle     = new Paddle(Side.Left, this);
     RightPaddle    = new Paddle(Side.Right, this);
     BallGoingRight = true;
     ResetBall();
 }
Beispiel #3
0
        /// <summary>
        /// Class constructor, creates a new Nom Nom! Game
        /// </summary>
        /// <param name="config">The hardware configuration</param>
        public Nomnom(ConsoleHardwareConfig config)
            : base(config)
        {
            DisplayDelay = 1;
#if toolboxspeaker
            // I used my own speaker class due to a small bug in the RTTL class from Nwazet
            config.Speaker.Dispose();
            this._speaker = new Speaker(Pins.GPIO_PIN_18);
#endif
        }
Beispiel #4
0
 public Quadris(ConsoleHardwareConfig config)
     : base(config)
 {
     World = new Composition(new byte[FieldHeight * FieldWidth / 8], FieldWidth, FieldHeight);
     ResetPlayfield();
     Tetromino = new Tetromino(this);
     RenderFrame();
     TimeToFall       = false;
     _timeToFallTimer = new Timer(OnTimerTick, null, TimeSpan.Zero, TimeSpan.FromTicks(TetrominoFallInterval));
     DisplayDelay     = 0;
 }
        public GameOfPaddles(ConsoleHardwareConfig config) : base(config)
        {
            Hardware.LeftButton.Input.DisableInterrupt();
            Hardware.RightButton.Input.DisableInterrupt();
            Hardware.LeftButton.Input.OnInterrupt  += OnLeftButtonClick;
            Hardware.RightButton.Input.OnInterrupt += OnRightButtonClick;
            Hardware.LeftButton.Input.EnableInterrupt();
            Hardware.RightButton.Input.EnableInterrupt();

            DisplaySplashScreen();

            World       = new Composition(new byte[] { 0, 0, 0, 0, 0, 0, 0, 0 }, ScreenSize, ScreenSize);
            Ball        = new PlayerMissile("ball", 0, 0, World);
            LeftPaddle  = new Paddle(Side.Left, this);
            RightPaddle = new Paddle(Side.Right, this);

            ResetBall(true);
        }
        public GameOfPaddles(ConsoleHardwareConfig config) : base(config)
        {
            World = new Composition(new byte[] { 0, 0, 0, 0, 0, 0, 0, 0 }, ScreenSize, ScreenSize);
            Ball  = new PlayerMissile {
                Name    = "ball",
                Owner   = World,
                IsEnemy = true
            };
            LeftPaddle  = new Paddle(Side.Left, this);
            RightPaddle = new Paddle(Side.Right, this);

            World.Coinc +=
                (s, a, b) => {
                Ball.HorizontalSpeed = -Ball.HorizontalSpeed;
                return(false);
            };

            ResetBall(true);
        }
 public GameOfMeteors(ConsoleHardwareConfig config)
     : base(config)
 {
     World        = new Composition(new byte[WorldSize * WorldSize / 8], WorldSize, WorldSize);
     World.Coinc += WorldCoinc;
     Ship         = new PlayerMissile("ship", WorldSize / 2, WorldSize / 2, World);
     Ship.X       = WorldSize / 2;
     Ship.Y       = WorldSize / 2;
     Pruneau      = new PlayerMissile {
         Name      = "Pruneau",
         Owner     = World,
         IsVisible = false
     };
     Meteors = new Meteor[NumberOfMeteors];
     for (var i = 0; i < NumberOfMeteors; i++)
     {
         Meteors[i] = new Meteor(this, i,
                                 new[] { 0, WorldSize - 2, 0, WorldSize - 2 }[i],
                                 new[] { 0, 0, WorldSize - 2, WorldSize - 2 }[i]);
     }
     DisplayDelay = 0;
 }
Beispiel #8
0
 public GameOfMeteors(ConsoleHardwareConfig config) : base(config) {
     World = new Composition(new byte[WorldSize * WorldSize / 8], WorldSize, WorldSize);
     World.Coinc += WorldCoinc;
     Ship = new PlayerMissile {
         Name = "Ship",
         Owner = World,
         X = WorldSize/2,
         Y = WorldSize/2
     };
     Pruneau = new PlayerMissile {
         Name = "Pruneau",
         Owner = World,
         IsVisible = false
     };
     Meteors = new Meteor[WinningNumberOfMeteors];
     for (var i = 0; i < Meteors.Length; i++) {
         Meteors[i] = new Meteor(this, i);
     }
     NumberOfMeteors = StartingNumberOfMeteors;
     SpawnMeteors();
     DisplayDelay = 0;
 }
Beispiel #9
0
 public Player(ConsoleHardwareConfig config)
     : base(config)
 {
 }