예제 #1
0
        public Engine(Field field, Fighter player, GameLevel gameLevel)
        {
            this.Field      = field;
            this.Player     = player;
            this.GameLevel  = gameLevel;
            this.GameStatus = GameStatus.Welcome;

            this.PlayerClassTypes   = ReflectiveArray.GetTypeOfDerivedClasses <Fighter>();
            this.EnemyClassTypes    = ReflectiveArray.GetTypeOfDerivedClasses <Enemy>();
            this.BuildingClassTypes = ReflectiveArray.GetTypeOfDerivedClasses <Building>();

            this.players   = new List <Fighter>();
            this.enemies   = new List <Enemy>();
            this.buildings = new List <Building>();

            this.welcomeMessageBox = new MessageBox(
                this.field,
                "Welcome to THUNDER FIGHTER!\nPress ENTER to start or ESC to exit...",
                MessageBoxDrawing.DrawCentered,
                MessageBoxTextAlignment.Center);

            this.pauseMessageBox = new MessageBox(
                this.field,
                "PAUSE!\nPress any key to continue...",
                MessageBoxDrawing.DrawCentered,
                MessageBoxTextAlignment.Center);

            this.gameOverMessageBox = new MessageBox(
                this.field,
                "GAME OVER!\nPress any key to continue...",
                MessageBoxDrawing.DrawCentered,
                MessageBoxTextAlignment.Center);
        }
예제 #2
0
        public Engine(Field field)
        {
            this.Field      = field;
            this.GameStatus = GameStatusType.Welcome;

            this.Player = new ThunderFighterOne(this.Field, new Point2D(10, 5));

            this.PlayerClassTypes   = ReflectiveArray.GetTypeOfDerivedClasses <Fighter>();
            this.EnemyClassTypes    = ReflectiveArray.GetTypeOfDerivedClasses <Enemy>();
            this.BuildingClassTypes = ReflectiveArray.GetTypeOfDerivedClasses <Building>();

            this.players   = new List <Fighter>();
            this.enemies   = new List <Enemy>();
            this.buildings = new List <Building>();

            this.counter = 0;

            this.Scores      = new ScoreBoard();
            this.GameCounter = -1;
            this.Timer       = TimeSpan.Zero;

            this.welcomeScreen  = new WelcomeScreen(this);
            this.pauseScreen    = new PauseScreen(this);
            this.gameOverScreen = new GameOverScreen(this);

            this.Menu = new Menu(this.Field, this);
            this.Menu.CreateBase();

            ConsoleKeyboardHandler.Instance.KeyDown += this.Instance_KeyDown;
        }