public override void Init()
        {
            //note(fede): Only at this point the Input field has been initialized by the form
            SoundManager.init(this.DirectSound);

            Scene.Input = Input;

            startMenu = new StartMenu()
                        .onGameStart(() => SetNextScene(this.shipScene))
                        .onGameExit(StopGame);

            pauseMenu = new PauseMenu()
                        .OnGoToStartMenu(() => {
                ResetGame();
                SetNextScene(startMenu);
            });

            ResetGame();

            //SetNextScene(new ShipScene(GameplayScene.InitialGameState));
            //SetNextScene(new TrainingScene());
            SetNextScene(startMenu);
        }
Example #2
0
        private void InitHUD()
        {
            int deviceWidth  = D3DDevice.Instance.Width;
            int deviceHeight = D3DDevice.Instance.Height;

            healthTextBox.Text     = "✚ 100";
            healthTextBox.Color    = Color.DarkOrange;
            healthTextBox.Position = new Point((int)FastMath.Floor(0.05f * deviceWidth), (int)FastMath.Floor(0.9f * deviceHeight));
            healthTextBox.Size     = new Size(600, 200);
            healthTextBox.changeFont(new Font("TimesNewRoman", 25, FontStyle.Bold));
            healthTextBox.Align = TgcText2D.TextAlign.LEFT;

            oxygenTextBox.Text     = "◴ 100";
            oxygenTextBox.Color    = Color.DarkOrange;
            oxygenTextBox.Position = new Point((int)FastMath.Floor(0.12f * deviceWidth), (int)FastMath.Floor(0.9f * deviceHeight));
            oxygenTextBox.Size     = new Size(600, 200);
            oxygenTextBox.changeFont(new Font("TimesNewRoman", 25, FontStyle.Bold));
            oxygenTextBox.Align = TgcText2D.TextAlign.LEFT;

            crossHair.Text     = "+";
            crossHair.Color    = Color.White;
            crossHair.Position = new Point(deviceWidth / 2 - 8, deviceHeight / 2 - 40);
            crossHair.Size     = new Size(600, 200);
            crossHair.changeFont(new Font("TimesNewRoman", 25, FontStyle.Regular));
            crossHair.Align = TgcText2D.TextAlign.LEFT;

            gameTimer.Text     = "Time: ";
            gameTimer.Color    = Color.DarkOrange;
            gameTimer.Position = new Point((int)FastMath.Floor(0.05f * deviceWidth), (int)FastMath.Floor(0.85f * deviceHeight));
            gameTimer.Size     = new Size(300, 600);
            gameTimer.changeFont(new Font("TimesNewRoman", 12, FontStyle.Regular));
            gameTimer.Align = TgcText2D.TextAlign.LEFT;

            pauseMenu     = new PauseMenu(this);
            principalMenu = new PrincipalMenu(this);
        }