Example #1
0
    static void Main(string[] args)
    {
        WelcomeScreen w = new WelcomeScreen();

        w.Display();

        bool finished = false;

        do
        {
            MenuScreen menu = new MenuScreen();
            menu.Display();
            switch (menu.GetChosenOption())
            {
            case MenuScreen.PLAY:
                Game g = new Game();
                g.Run();
                break;

            case MenuScreen.CREDITS:
                CreditsScreen c = new CreditsScreen();
                c.Display();
                break;

            case MenuScreen.QUIT:
                finished = true;
                break;
            }
        }while (!finished);
    }
Example #2
0
        /// <summary>
        /// This function creates a screen object and inserts it in an internal
        /// list and also inserts it in an interface list for external use
        /// </summary>
        public void CreateScreens()
        {
            fadeArea       = new Rectangle(0, 0, Globals.ScreenWidth, Globals.ScreenHeight);
            selectedScreen = EScreen.MainScreen;
            Screen screen = new MainScreen(this);

            screens.Add(screen);
            iScreens.Add((IScreen)screen);
            screen = new GameScreen(this);
            screens.Add(screen);
            iScreens.Add((IScreen)screen);
            screen = new CreditsScreen(this);
            screens.Add(screen);
            iScreens.Add((IScreen)screen);
            screen = new SetupScreen(this);
            screens.Add(screen);
            iScreens.Add((IScreen)screen);
            screen = new MenuScreen(this);
            screens.Add(screen);
            iScreens.Add((IScreen)screen);
            screen = new WinScreen(this);
            screens.Add(screen);
            iScreens.Add((IScreen)screen);
            screen = new DialogScreen(this, ExitGame, LeaveDialog);
            iDialogScreens.Add((IScreen)screen);
        }
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            Font          = Fonts.Ariel14Bold;
            ScreenManager = new ScreenManager(this);
            var splashScreen = new LogoScreen();
            var menu         = new MainMenuScreen();
            var gameplay     = new GameplayScreen();
            var gameOver     = new GameOverScreen();
            var credits      = new CreditsScreen();

            if (DEV_MODE)
            {
                gameplay.Activate();
            }
            else
            {
                splashScreen.Activate();
            }
            ScreenManager.AddScreen(GameScreens.SplashScreen, splashScreen);
            ScreenManager.AddScreen(GameScreens.MainMenu, menu);
            ScreenManager.AddScreen(GameScreens.GamePlay, gameplay);
            ScreenManager.AddScreen(GameScreens.GameOver, gameOver);
            ScreenManager.AddScreen(GameScreens.Credits, credits);
            base.Initialize();
        }
 //All of the functions are used to control the menu and the panel visibility
 // Use this for initialization
 void Start()
 {
     CreditsScreen.SetActive(false);
     JoinMenu.SetActive(false);
     ControlsScreen.SetActive(false);
     storeSelected = eventSystem.firstSelectedGameObject;
 }
Example #5
0
        static void Main(string[] args)
        {
            bool fullScreen = false;

            Hardware.Init(1024, 768, 24, fullScreen);
            bool finished = false;

            while (!finished)
            {
                WelcomeScreen welcome = new WelcomeScreen();
                welcome.Run();

                if (welcome.GetOptionChosen() == WelcomeScreen.options.Credits)
                {
                    CreditsScreen credits = new CreditsScreen();
                    credits.Run();
                }

                if (welcome.GetOptionChosen() == WelcomeScreen.options.Play)
                {
                    Game myGame = new Game();
                    myGame.Run();

                    GameOverScreen gameEnd = new GameOverScreen();
                    gameEnd.Run();
                }

                if (welcome.GetOptionChosen() == WelcomeScreen.options.Quit)
                {
                    finished = true;
                }
            }
        }
Example #6
0
    public static void Main(string[] args)
    {
        bool fullScreen = false;

        SdlHardware.Init(960, 750, 24, fullScreen);

        WelcomeScreen w = new WelcomeScreen();

        do
        {
            w.Run();
            if (w.GetChosenOption() == 1)
            {
                Game g = new Game();
                g.Run();
            }
            else if (w.GetChosenOption() == 2)
            {
                HelpScreen help = new HelpScreen();
                help.Run();
            }
            else if (w.GetChosenOption() == 3)
            {
                CreditsScreen credits = new CreditsScreen();
                credits.Run();
            }
        } while (w.GetChosenOption() != 4);
    }
 public void ControlsOpen()
 {
     ControlsScreen.SetActive(true);
     CreditsScreen.SetActive(false);
     MainMenu.SetActive(false);
     eventSystem.SetSelectedGameObject(secondReturnButton);
 }
Example #8
0
    static void Main(string[] args)
    {
        bool fullScreen = false;

        Hardware.Init(1024, 768, 24, fullScreen);
        bool finished = false;

        while (!finished)
        {
            WelcomeScreen welcome = new WelcomeScreen();
            welcome.Run();

            if (welcome.GetOptionChosen() == WelcomeScreen.options.Credits)
            {
                CreditsScreen credits = new CreditsScreen();
                credits.Run();
            }

            if (welcome.GetOptionChosen() == WelcomeScreen.options.Play)
            {
                // Matrix myMatrix = new Matrix();
                //myMatrix.Run();
            }

            if (welcome.GetOptionChosen() == WelcomeScreen.options.Quit)
            {
                finished = true;
            }
        }
    }
Example #9
0
    public static void Main()
    {
        bool fullScreen = false;

        SdlHardware.Init(1024, 720, 24, fullScreen);

        WelcomeScreen w = new WelcomeScreen();

        do
        {
            w.Run();
            if (w.GetChosenOption() == 1)
            {
                Game g = new Game();
                g.Run();
            }
            else if (w.GetChosenOption() == 2)
            {
                CreditsScreen credits = new CreditsScreen();
                credits.Run();
            }
            else if (w.GetChosenOption() == 3)
            {
                HelpScreen help = new HelpScreen();
                help.Run();
            }
            else if (w.GetChosenOption() == 4)
            {
                ScoreBoard sb = new ScoreBoard();
                sb.Run();
            }
        } while (w.GetChosenOption() != 5);
    }
Example #10
0
    static void Main()
    {
        bool fullScreen = false;

        SdlHardware.Init(1024, 768, 24, fullScreen);

        WelcomeScreen w = new WelcomeScreen();

        do
        {
            w.Run();
            if (w.GetChosenOption() == WelcomeScreen.OPTION_PLAY)
            {
                Game g = new Game();
                g.Run();
            }
            else if (w.GetChosenOption() == WelcomeScreen.OPTION_HELP)
            {
                HelpScreen help = new HelpScreen();
                help.Run();
            }
            else if (w.GetChosenOption() == WelcomeScreen.OPTION_CREDITS)
            {
                CreditsScreen credits = new CreditsScreen();
                credits.Run();
            }
        }while (w.GetChosenOption() != WelcomeScreen.OPTION_QUIT);
    }
Example #11
0
    public void Run()
    {
        ConfigureConsole();

        bool exit = false;

        do
        {
            PrintBorders();

            int  option         = 1;
            bool selectedOption = false;
            do
            {
                PrintMenu(option, Spanish);
                GetChosenOption(ref option, ref selectedOption);
            } while (!selectedOption);

            switch (option)
            {
            case 1:
                Calendar calendar = new Calendar(); calendar.Run();
                break;

            case 2:
                Contacts contacts = new Contacts(); contacts.Run();
                break;

            case 3:
                TaskToDo tasks = new TaskToDo(); tasks.Run();
                break;

            case 4:
                Notes notes = new Notes(); notes.Run();
                break;

            case 5:
                ConfigurationConsole config = new ConfigurationConsole();
                config.Run();
                break;

            case 6:
                CreditsScreen credits = new CreditsScreen();
                credits.Run();
                break;

            case 7:
                Spanish = !Spanish;
                break;

            case 0:
                exit = true;
                break;

            default: break;
            }
        } while (!exit);
    }
Example #12
0
    void Start()
    {
        menuController = GetComponent<MenuKeysController>();
        credits = GetComponent<CreditsScreen>();
        credits.enabled = false;
        tutorial = GetComponent<TutorialScreen>();
        tutorial.enabled = false;

        rect = new Rect(Screen.width / 2 - LarguraTitulo / 2, 60, LarguraTitulo, 100);
    }
Example #13
0
    // Use this for initialization
    void Start()
    {
        gameHUD         = GetComponentInParent <GameHUD>();
        howToPlayScreen = GameObject.Find("How To Play Screen").GetComponent <HowToPlayScreen>();
        mainMenuScreen  = GameObject.Find("Main Menu Screen").GetComponent <MainMenuScreen>();
        creditsScreen   = GameObject.Find("Credits Screen").GetComponent <CreditsScreen>();

        // Title Screen Text
        pauseText = GetComponentInChildren <Text>();

        // Resume Button
        resume       = transform.Search("Resume Button").gameObject;
        resumeSprite = resume.GetComponent <Image>();
        resumeBtn    = resume.GetComponent <Button>();
        resumeText   = resumeBtn.GetComponentInChildren <Text>();
        resumeBtn.onClick.AddListener(ResumeClicked);

        // How to Play Button
        howToPlay       = transform.Search("How To Play Button").gameObject;
        howToPlaySprite = howToPlay.GetComponent <Image>();
        howToPlayBtn    = howToPlay.GetComponent <Button>();
        howToPlayText   = howToPlayBtn.GetComponentInChildren <Text>();
        howToPlayBtn.onClick.AddListener(HowToPlayClicked);

        // Sound Toggle Button
        sound          = transform.Search("Sound Button").gameObject;
        soundprite     = sound.GetComponent <Image>();
        soundBtn       = sound.GetComponent <Button>();
        soundText      = soundBtn.GetComponentInChildren <Text>();
        soundText.text = GameDataManager.Instance.IsSound ? SOUND_ON_TEXT : SOUND_OFF_TEXT;
        soundBtn.onClick.AddListener(SoundToggleClicked);

        // Credits Button
        credits       = transform.Search("Credits Button").gameObject;
        creditsSprite = credits.GetComponent <Image>();
        creditsBtn    = credits.GetComponent <Button>();
        creditsText   = creditsBtn.GetComponentInChildren <Text>();
        creditsBtn.onClick.AddListener(CreditsClick);

        // Quit Button
        quit       = transform.Search("Quit Button").gameObject;
        quitSprite = quit.GetComponent <Image>();
        quitBtn    = quit.GetComponent <Button>();
        quitText   = quitBtn.GetComponentInChildren <Text>();
        quitBtn.onClick.AddListener(QuitClicked);

        blanket = transform.Search("Blanket").GetComponent <Image>();

        ready = true;

        Hide();
    }
Example #14
0
    public void Start()
    {
        Hardware             hardware = new Hardware(1024, 720, 24, false);
        WelcomeScreen        welcome  = new WelcomeScreen(hardware);
        LanguageSelectScreen languaje = new LanguageSelectScreen(hardware);

        welcome.Run();
        languaje.Run();
        MenuScreen menu = new MenuScreen(hardware, languaje.languaje);

        do
        {
            GameScreen    game    = new GameScreen(hardware);
            HelpScreen    help    = new HelpScreen(hardware, languaje.languaje);
            StatsScreen   stats   = new StatsScreen(hardware, languaje.languaje);
            CreditsScreen credits = new CreditsScreen(hardware, languaje.languaje);

            Player   p = Player.GetPlayer();
            DateTime begin;
            DateTime timeEnd;

            hardware.ClearScreen();
            menu.exit   = false;
            menu.option = -1;
            Console.WriteLine("Menu");
            menu.Run();

            switch (menu.option)
            {
            case 0:
                help.Run();
                begin = DateTime.Now;
                game.Run();
                timeEnd = DateTime.Now;
                TimeSpan       time = timeEnd - begin;
                GameOverScreen end  = new GameOverScreen(hardware, time, languaje.languaje);
                end.Run();
                break;

            case 1:
                stats.Run();
                break;

            case 2:
                credits.Run();
                break;
            }
            Thread.Sleep(50);
        } while (menu.option != 3 ||
                 hardware.IsKeyPressed(Hardware.KEY_ESC));
    }
Example #15
0
    public static void Start()
    {
        Hardware hardware = new Hardware(800, 600, 24, false);

        WelcomeScreen welcome = new WelcomeScreen(hardware);
        CreditsScreen credits = new CreditsScreen(hardware);
        MenuScreen    menu    = new MenuScreen(hardware);
        GameScreen    game    = new GameScreen(hardware);

        welcome.Show();
        menu.Show();
        game.Show();
        credits.Show();
    }
Example #16
0
        /// <summary>
        /// Gestiona cualquier pulsación para <see cref="CreditsScreen"/>
        /// </summary>
        /// <param name="creditsScreen">Escena de créditos que llama al método</param>
        /// <param name="gameTime">Valor de tiempo actual</param>
        public static void Credits(CreditsScreen creditsScreen, GameTime gameTime)
        {
            MouseState mState = Mouse.GetState();

            if (mState.LeftButton == ButtonState.Pressed && mOldState.LeftButton == ButtonState.Released)
            {
                if (creditsScreen.backRect.Contains(mState.Position))   //back
                {
                    GameMain.currentScreen = new MenuScreen(creditsScreen.Content, creditsScreen.GraphicsDevice);
                }
            }

            mOldState = mState;
        }
    public ScreensManager()
    {
        graphics = new GraphicsDeviceManager(this);
        Content.RootDirectory = "Content";

        game       = new GameMain(1280, 720);
        welcomeScr = new WelcomeScreen(this);
        loadingScr = new LoadingScreen(this);
        creditsScr = new CreditsScreen(this);
        configScr  = new ConfigScreen(this);
        helpScr    = new HelpScreen(this);
        endScr     = new EndScreen(this);

        currentMode = MODE.LOADING;
    }
Example #18
0
        public void Start()
        {
            Hardware hardware = new Hardware(SCREEN_WIDTH, SCREEN_HEIGHT,
                                             24, false);
            bool exit = false;

            WelcomeScreen welcome = new WelcomeScreen(hardware);

            welcome.Show();
            MenuScreen menu = new MenuScreen(hardware);

            do
            {
                menu.Show();

                switch (menu.ChosenOption)
                {
                case 1:
                    GameScreen game = new GameScreen(hardware, 0);
                    game.Show();
                    break;

                case 2:
                    LoadScreen load = new LoadScreen(hardware);
                    load.Show();

                    // To load the selected level
                    GameScreen gameLoaded = new GameScreen(hardware,
                                                           load.NumLevel);
                    gameLoaded.Show();
                    break;

                case 3:
                    ScoreBoard score = new ScoreBoard(hardware);
                    score.Show();
                    break;

                case 4:
                    CreditsScreen credits = new CreditsScreen(hardware);
                    credits.Show();
                    break;

                default:
                    exit = true;
                    break;
                }
            } while (!exit);
        }
Example #19
0
    public void Run()
    {
        Hardware      hardware = new Hardware(1000, 600, 24, false);
        WelcomeScreen welcome  = new WelcomeScreen(hardware);
        MenuScreen    menu     = new MenuScreen(hardware);

        welcome.Run();
        bool exit = false;

        do
        {
            menu.Run();
            switch (menu.GetChosenOption())
            {
            case MenuScreen.MenuOption.Game:
                NumPlayersScreen nps = new NumPlayersScreen(hardware);
                nps.Run();
                GameScreen game = new GameScreen(hardware,
                                                 nps.NumPlayers, nps.NumsToken);
                game.Run();
                break;

            case MenuScreen.MenuOption.Load:
                LoadScreen ls = new LoadScreen(hardware);
                ls.Run();
                break;

            case MenuScreen.MenuOption.Credits:
                CreditsScreen cs = new CreditsScreen(hardware);
                cs.Run();
                break;

            case MenuScreen.MenuOption.ChangeLenguage:
                ChangeLenguageScreen cls =
                    new ChangeLenguageScreen(hardware);
                cls.Run();
                break;

            case MenuScreen.MenuOption.Exit:
                exit = true;
                break;
            }
        }while (!exit);
    }
Example #20
0
    public void Run()
    {
        Int32 number;

        do
        {
            ShowMenu();
            bool cFormat = Int32.TryParse(Console.ReadLine(), out number);

            // Incorrect Format
            if (!cFormat)
            {
                number = 10;
            }

            switch (number)
            {
            case 1:
                SalesModule sales = new SalesModule();
                sales.Run();
                break;

            case 2:
                AdminModule admin = new AdminModule();
                admin.Run();
                break;

            case 3:
                CreditsScreen.Display();
                break;

            case 0:
                Console.SetCursorPosition(Console.WindowWidth / 2 - 3,
                                          Console.WindowHeight / 2);
                Console.WriteLine("Bye");
                break;

            default:
                Console.WriteLine("Wrong option");
                Console.WriteLine();
                break;
            }
        }while (number != 0);
    }
Example #21
0
    public void Start()
    {
        Hardware          hardware   = new Hardware(840, 755, 24, false);
        WelcomeScreen     welcome    = new WelcomeScreen(hardware);
        SettingScreen     setting    = new SettingScreen(hardware);
        ControllerScreen  controller = new ControllerScreen(hardware);
        CreditsScreen     credits    = new CreditsScreen(hardware);
        MapCreationScreen mapedition = new MapCreationScreen(hardware);
        SelectLenguage    select     = new SelectLenguage(hardware);

        do
        {
            hardware.ClearScreen();
            select.Show();
            if (!welcome.GetExit())
            {
                welcome.Show();
                switch (welcome.GetChosenOption())
                {
                case 1:
                    setting.Show();
                    break;

                case 2:
                    mapedition.Show();
                    break;

                case 3:
                    controller.Show();
                    break;

                case 4:
                    credits.Show();
                    break;

                case 5:
                    welcome.GetExit();
                    break;
                }
            }
        } while (!welcome.GetExit());
    }
Example #22
0
        public HostileSpace()
        {
            LoadSettings();
            LoadPlayerData();

            ContextSettings contextSettings = new ContextSettings();

            contextSettings.AntialiasingLevel = 16;
            window = new RenderWindow(new VideoMode(settings.ResolutionX, settings.ResolutionY), "Hostile Space", Styles.None, contextSettings);
            window.SetMouseCursorVisible(false);
            window.SetVerticalSyncEnabled(false);

            contentManager = new ContentManager();

            fpsCounter = new FPSCounter(this);
            input      = new Input(this);

            musicPlayer = new MusicPlayer(this);
            audioPlayer = new AudioPlayer(this);

            background = new Background(this);

            mainScreen = new MainScreen(this);
            mainScreen.NewGameBTN.ButtonPressed  += NewGameBTN_ButtonPressed;
            mainScreen.SettingsBTN.ButtonPressed += SettingsBTN_ButtonPressed;
            mainScreen.CreditsBTN.ButtonPressed  += CreditsBTN_ButtonPressed;

            gameScreen = new GameScreen(this);

            settingsScreen = new SettingsScreen(this);
            settingsScreen.Back.ButtonPressed += Back_ButtonPressed;
            creditsScreen = new CreditsScreen(this);
            creditsScreen.Back.ButtonPressed += Back_ButtonPressed;

            currentScreen = mainScreen;
            currentScreen.Activate();

            camera = window.DefaultView;
            input.Keyboard.F12Pressed += Keyboard_F12Pressed;

            window.MouseWheelMoved += Window_MouseWheelMoved;
        }
Example #23
0
 public void InitializeScreens()
 {
     m_gameOverScreen      = new GameOverScreen();
     SkillScreen           = new SkillScreen();
     m_blacksmithScreen    = new BlacksmithScreen();
     m_getItemScreen       = new GetItemScreen();
     m_enchantressScreen   = new EnchantressScreen();
     DialogueScreen        = new DialogueScreen();
     m_pauseScreen         = new PauseScreen();
     m_optionsScreen       = new OptionsScreen();
     m_profileCardScreen   = new ProfileCardScreen();
     m_creditsScreen       = new CreditsScreen();
     m_skillUnlockScreen   = new SkillUnlockScreen();
     m_diaryEntryScreen    = new DiaryEntryScreen();
     m_deathDefyScreen     = new DeathDefiedScreen();
     m_textScreen          = new TextScreen();
     m_flashbackScreen     = new DiaryFlashbackScreen();
     m_gameOverBossScreen  = new GameOverBossScreen();
     m_profileSelectScreen = new ProfileSelectScreen();
 }
Example #24
0
    static void Main()
    {
        bool fullScreen = false;

        SdlHardware.Init(1024, 700, 24, fullScreen);

        ChooseLanguage l = new ChooseLanguage();
        WelcomeScreen  w = new WelcomeScreen();

        do
        {
            if (l.GetChosenOption() == 0)
            {
                l.Run();
            }
            if (l.GetChosenOption() != 0)
            {
                w.Run();
                if (w.GetChosenOption() == 1)
                {
                    Game g = new Game();
                    g.Run();
                }
                else if (w.GetChosenOption() == 2)
                {
                    Controls controls = new Controls();
                    controls.Run();
                }
                else if (w.GetChosenOption() == 3)
                {
                    CreditsScreen credits = new CreditsScreen();
                    credits.Run();
                }
                else if (w.GetChosenOption() == 5)
                {
                    Tricks tricks = new Tricks();
                    tricks.Run();
                }
            }
        }while (w.GetChosenOption() != 4);
    }
Example #25
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            GameContent.Initialize(Content);

            // Create a new SpriteBatch, which can be used to draw textures.
            _spriteBatch = new SpriteBatch(GraphicsDevice);

            _introScreen   = new IntroScreen(this);
            _mainMenu      = new TitleScreen(this);
            _credits       = new CreditsScreen(this);
            _gameOver      = new GameOverScreen(this);
            _options       = new OptionsScreen(this);
            _loadscreen    = new LoadScreen(this);
            _savescreen    = new SaveScreen(this);
            _loadingScreen = new LoadingScreen(this);
            _howToPlay     = new HowToPlay(this);

            GameStateManager.Parent = this;

            //System.Threading.ThreadPool.QueueUserWorkItem(LoadContentAsync);
        }
Example #26
0
 public IntoTheBlaze()
 {
     graphics = new GraphicsDeviceManager(this)
     {
         PreferredBackBufferWidth  = 1024,
         PreferredBackBufferHeight = 640
     };
     Window.Title = "Into The Blaze";
     graphics.ApplyChanges();
     Content.RootDirectory = "Content";
     MenuScreen            = new MenuScreen();
     LevelSelectScreen     = new LevelSelectScreen();
     CreditsScreen         = new CreditsScreen();
     LevelScreen           = new LevelScreen();
     LevelEndScreen        = new LevelEndScreen();
     screen    = null;
     updateFps = new Queue <float>();
     updateFps.Enqueue(0);
     drawFps = new Queue <float>();
     drawFps.Enqueue(0);
 }
Example #27
0
    public void Start()
    {
        Hardware hardware =
            new Hardware(SCREEN_WIDTH, SCREEN_HEIGHT, 24, false);

        WelcomeScreen welcome = new WelcomeScreen(hardware, this);
        MenuScreen    menu    = new MenuScreen(hardware, this);
        CreditsScreen credits = new CreditsScreen(hardware, this);

        hardware.ClearScreen();
        welcome.Show();

        do
        {
            hardware.ClearScreen();
            menu.Show();
            hardware.ClearScreen();
            credits.Show();
        }while (!menu.GetExit());
        SetLanguaje();
    }
Example #28
0
    public void Run()
    {
        // TO DO: Create a real Menu, instead of showing all the screens

        IntroScreen intro = new IntroScreen();

        intro.Run();

        MenuScreen menu = new MenuScreen();

        do
        {
            menu.Run();
            switch (menu.GetChosenOption())
            {
            case MenuScreen.MenuOption.Game:
                Game g = new Game(menu.RetroLook);
                g.Run();
                break;

            case MenuScreen.MenuOption.Help:
                HelpScreen help = new HelpScreen(menu.RetroLook);
                help.Run();
                break;

            case MenuScreen.MenuOption.Credits:
                CreditsScreen credits = new CreditsScreen(menu.RetroLook);
                credits.Run();
                break;

            case MenuScreen.MenuOption.Scores:
                HiScoresScreen hiScores = new HiScoresScreen(menu.RetroLook);
                hiScores.Run();
                break;
            }
        } while (menu.GetChosenOption() != MenuScreen.MenuOption.Exit);
    }
Example #29
0
    public static void Main(string[] args)
    {
        SdlHardware.Init(1280, 720, 24, false);

        LoadingScreen ls = new LoadingScreen();

        ls.Run();

        WelcomeScreen welcome = new WelcomeScreen();

        do
        {
            welcome.Run();
            if (welcome.GetChosenOption() == WelcomeScreen.OPTION_PLAY)
            {
                Game g = new Game();
                g.Run();
                EndScreen end = new EndScreen();
                end.Run();
            }
            else if (welcome.GetChosenOption() == WelcomeScreen.OPTION_HELP)
            {
                HelpScreen help = new HelpScreen();
                help.Run();
            }
            else if (welcome.GetChosenOption() == WelcomeScreen.OPTION_CREDITS)
            {
                CreditsScreen credits = new CreditsScreen();
                credits.Run();
            }
            else if (welcome.GetChosenOption() == WelcomeScreen.OPTION_CONFIG)
            {
                ConfigScreen config = new ConfigScreen();
                config.Run();
            }
        }while (welcome.GetChosenOption() != WelcomeScreen.OPTION_QUIT);
    }
Example #30
0
        public void Start()
        {
            Hardware hardware = new Hardware(800, 600, 24, false);

            WelcomeScreen      welcome      = new WelcomeScreen(hardware);
            CreditsScreen      credits      = new CreditsScreen(hardware);
            PlayerSelectScreen playerSelect = new PlayerSelectScreen(hardware);
            GameScreen         game         = new GameScreen(hardware);

            do
            {
                hardware.ClearScreen();
                welcome.Show();
                if (!welcome.GetExit())
                {
                    playerSelect.Show();
                    game.ChosenPlayer = playerSelect.GetChosenPlayer();
                    hardware.ClearScreen();
                    game.Show();
                    hardware.ClearScreen();
                    credits.Show();
                }
            } while (!welcome.GetExit());
        }
Example #31
0
 public void OnCreditsPressed()
 {
     CreditsScreen.Open();
 }
Example #32
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // set up the display window
            graphics.PreferredBackBufferWidth = 500;
            graphics.PreferredBackBufferHeight = 500;
            graphics.ApplyChanges();

            // update the ViewportHeight and ViewportWidth constants so the screens know
            // how to draw themselves
            GameConstants.ViewportHeight = graphics.GraphicsDevice.Viewport.Height;
            GameConstants.ViewportWidth = graphics.GraphicsDevice.Viewport.Width;

            // display title in the window
            Window.Title = "Alien Attack";

            // setup the state of the game
            currentGameState = GameConstants.GameState.Title;
            currentKeyboardState = Keyboard.GetState();
            prevKeyBoardState = currentKeyboardState;

            // set up the screens
            titleScreen = new TitleScreen();
            instructionScreen = new InstructionScreen();
            highScoreScreen = new HighScoreScreen();
            creditsScreen = new CreditsScreen();
            introScreen = new IntroScreen();
            readyScreen = new GetReadyScreen();
            gameOverScreen = new GameOverScreen();

            // set up the game objects
            gameCamera = new Camera();
            player = new Player();
            enemies = new Enemies();
            map = new Map();
            miniMap = new MiniMap();
            skybox = new Skybox();

            // set up the ingame displays
            score = new Score();
            highScore = new HighScore();

            // set up the soundtrack
            gameSongs = new GameSongs();

            base.Initialize();
        }