Пример #1
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // TODO: use this.Content to load your game content here
            Shared.Stage = new Vector2(graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight);

            // instantiate all scenes
            startScene = new StartScene(this, spriteBatch);
            this.Components.Add(startScene);

            actionScene = new ActionScene(this, spriteBatch);
            this.Components.Add(actionScene);

            helpScene = new HelpScene(this, spriteBatch);
            this.Components.Add(helpScene);

            highScoreScene = new HighScoreScene(this, spriteBatch);
            this.Components.Add(highScoreScene);

            aboutScene = new AboutScene(this, spriteBatch);
            this.Components.Add(aboutScene);

            gameOverScene = new GameOverScene(this, spriteBatch);
            this.Components.Add(gameOverScene);

            // show start scene
            startScene.Show();
        }
Пример #2
0
    public void ShowDifficultyScene()
    {
        // Disable Help scene
        HelpScene.SetActive(false);

        // Show Difficulty scene
        DifficultyScene.SetActive(true);
    }
Пример #3
0
    public void ShowHelpScene()
    {
        // Disable Play button
        PlayButton.SetActive(false);
        SoundButton.SetActive(false);
        ShopButton.SetActive(false);

        // Show Help scene
        HelpScene.SetActive(true);
    }
Пример #4
0
        /// <summary>
        /// Loads all of the content to play the game, loads all the scenes and the music for the scenes
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // Adding our scenes to our components aswell as to the services
            // to be able to directly access the components list from other classes

            menuScene = new MenuScene(this, spriteBatch);
            this.Components.Add(menuScene);
            this.Services.AddService <MenuScene>(menuScene);
            menuScene.Show();

            actionScene = new ActionScene(this, spriteBatch);
            this.Components.Add(actionScene);
            this.Services.AddService <ActionScene>(actionScene);
            actionScene.Hide();

            helpScene = new HelpScene(this, spriteBatch);
            this.Components.Add(helpScene);
            this.Services.AddService <HelpScene>(helpScene);
            helpScene.Hide();

            creditScene = new CreditScene(this, spriteBatch);
            this.Components.Add(creditScene);
            this.Services.AddService <CreditScene>(creditScene);
            creditScene.Hide();

            gameOverScene = new GameOverScene(this, spriteBatch);
            this.Components.Add(gameOverScene);
            this.Services.AddService <GameOverScene>(gameOverScene);
            gameOverScene.Hide();

            // Getting the music for the scenes
            menuSong   = this.Content.Load <Song>("Music/Menu");
            actionSong = this.Content.Load <Song>("Music/Action");
            MediaPlayer.Play(menuSong);
            MediaPlayer.IsRepeating = true;
            MediaPlayer.Volume      = 0.1f;
        }
Пример #5
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            _resources = new Resources(this);

            // Add startScene
            startScene = new StartScene(this, spriteBatch);
            Components.Add(startScene);
            startScene.Show(true);

            // Add playScene
            playScene = new GameScene(this, spriteBatch);
            Components.Add(playScene);
            playScene.Show(false);

            // Add creditsScene
            creditsScene = new CreditsScene(this, spriteBatch);
            Components.Add(creditsScene);
            creditsScene.Show(false);

            // Add helpScene
            helpScene = new HelpScene(this, spriteBatch);
            Components.Add(helpScene);
            helpScene.Show(false);

            // Add highScoreScene
            highScoreScene = new HighScoreScene(this, spriteBatch);
            Components.Add(highScoreScene);
            highScoreScene.Show(false);

            // Create enterSound
            enterSoundIns = this.Content.Load <SoundEffect>("Sounds/enterSound").CreateInstance();

            // Create and play music
            menuMusic = this.Content.Load <Song>("Sounds/pauseMenu");
            MediaPlayer.Play(menuMusic);
        }
Пример #6
0
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            _spriteBatch = new SpriteBatch(_graphics.GraphicsDevice);
            Services.AddService(typeof(SpriteBatch), _spriteBatch);

            _audio = new AudioLibrary();
            _audio.LoadContent(this.Content);
            Services.AddService(typeof(AudioLibrary), _audio);

            helpBackgroundTexture = Content.Load<Texture2D>("helpbackground");
            helpForegroundTexture = Content.Load<Texture2D>("helpforeground");
            _helpScene = new HelpScene(this, helpBackgroundTexture, helpForegroundTexture);
            Components.Add(_helpScene);

            // Create the Start scene
            smallFont = Content.Load<SpriteFont>("menuSmall");
            largeFont = Content.Load<SpriteFont>("menuLarge");
            startBackgroundTexture = Content.Load<Texture2D>("startBackground");
            startElementsTexture = Content.Load<Texture2D>("startSceneElements");
            _startScene = new StartScene(this, smallFont, largeFont, startBackgroundTexture, startElementsTexture);
            Components.Add(_startScene);
            _creditScene = new CreditScene(this, smallFont, largeFont, startBackgroundTexture, startElementsTexture);
            Components.Add(_creditScene);

            actionElementsTexture = Content.Load<Texture2D>("rockrainenhanced");
            actionBackgroundTexture = Content.Load<Texture2D>("spacebackground");
            scoreFont = Content.Load<SpriteFont>("score");
            scoreFont = Content.Load<SpriteFont>("score");
            //_actionScene = new ActionScene(this, actionElementsTexture, actionBackgroundTexture, _scoreFont);
            //Components.Add(_actionScene);

            _joinScene = new JoinScene(this, largeFont, menuControllers);
            Components.Add(_joinScene);
            _startScene.Show();
            _activeScene = _startScene;
        }