Пример #1
0
        public Menu()
        {
            if (_once == false)
            {
                _once = true;
                DisplayMusicRequest(true);
            }

            _dao.Load();
            _preloader = SpriteLoader.GetInstance();
            _sceneManager = SceneManager.GetInstance();
               // _cursor = _preloader.Load("cursor");
            _scenery = _preloader.Load("scene");
            _title = _preloader.Load("title");
            _buttons.Add(new Button(new Vector2(260, 300), SceneManager.Scenes.PLAYSTATE, "Play", true));
            _buttons.Add(new Button(new Vector2(260, 400), SceneManager.Scenes.CREDITS, "Credits", true));
            _buttons.Add(new Button(new Vector2(260, 500), SceneManager.Scenes.HOWTO, "How To", true));
            _buttons.Add(new Button(new Vector2(20, 700), SceneManager.Scenes.SONG1, "Track 1",false));
            _buttons.Add(new Button(new Vector2(115, 700), SceneManager.Scenes.SONG2, "Track 2", false));
            _buttons.Add(new Button(new Vector2(215, 700), SceneManager.Scenes.SONG3, "Track 3", false));
            _buttons.Add(new Button(new Vector2(315, 700), SceneManager.Scenes.SONG4, "Track 4", false));
            _buttons.Add(new Button(new Vector2(415, 700), SceneManager.Scenes.SONG5, "Track 5", false));
            _buttons.Add(new Button(new Vector2(50,50), SceneManager.Scenes.MUSIC, "Music", false));

            _highScores = "HIGHSCORES:--- \n ";
            for (int i = 0; i < _dao._highscores.Count; i++)
            {
                _highScores += i + 1 + ": " + _dao._highscores[i]._highscore + "\n";
            }
            if (Menu._playingMusic == true)
            {
                _preloader.PlayMusic("song1");
            }
        }
Пример #2
0
 public static SceneManager GetInstance()
 {
     if (_me == null)
     {
         _me = new SceneManager();
     }
     return _me;
 }
Пример #3
0
        public Credits()
        {
            _preloader = SpriteLoader.GetInstance();
            _sceneManager = SceneManager.GetInstance();
             _scenery = _preloader.Load("scene");

            _buttons.Add(new Button(new Vector2(150, 500), SceneManager.Scenes.MENU, "Back", true));
        }
Пример #4
0
 //private Texture2D _cursor;
 public TutorialScreen()
 {
     _preloader = SpriteLoader.GetInstance();
     _page1 = _preloader.Load("page1");
     _page2 = _preloader.Load("page2");
     _sceneManager = SceneManager.GetInstance();
       //  _cursor = _preloader.Load("cursor");
 }
Пример #5
0
 public PlayState(GraphicsDevice _graphicsDevice)
 {
     _hud = new HUD();
     _spawner = new BlockSpawner(_graphicsDevice);
     _preloader.PlayMusic(Menu._song);
     _scenery = _preloader.Load("scene");
     _pauseButton = new Button(new Vector2(150, 730), SceneManager.Scenes.PAUSED, "Pause", true);
     _unPauseButton = new Button(new Vector2(150, 200), SceneManager.Scenes.UNPAUSED, "Continue?", true);
     _quitButton = new Button(new Vector2(150, 300), SceneManager.Scenes.MENU, "Quit?", true);
     _sceneManager = SceneManager.GetInstance();
 }
Пример #6
0
 // HighScoreList _highScoreList = new HighScoreList("MyScores");
 public WinScreen()
 {
     _preloader = SpriteLoader.GetInstance();
     _sceneManager = SceneManager.GetInstance();
       //  _cursor = _preloader.Load("cursor");
     _scenery = _preloader.Load("scene");
     _buttons.Add(new Button(new Vector2(150, 500), SceneManager.Scenes.MENU, "Back",true));
     _dao = DAO.GetInstance();
     _dao.AddHighscore(HUD._score);
     SoundEffect _effect =  _preloader.LoadEffect("win");
     if (Menu._playingMusic == true)
     {
         _effect.Play();
         _preloader.StopMusic();
     }
 }
Пример #7
0
 public Button(Vector2 _pos,SceneManager.Scenes _OnClick,String _text,bool _big)
 {
     this._big = _big;
     this._pos = _pos;
     this._text = _text;
     this._onClick = _OnClick;
     _sceneManager = SceneManager.GetInstance();
     _preloader = SpriteLoader.GetInstance();
     if (_big)
     {
         _texture = _preloader.Load("button");
     }
     else
     {
         _texture = _preloader.Load("smallbutton");
     }
 }
Пример #8
0
 public Splash()
 {
     _preloader = SpriteLoader.GetInstance();
     _sceneManager = SceneManager.GetInstance();
     _texture = _preloader.Load("splash");
 }
Пример #9
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);
     _preloader = SpriteLoader.GetInstance();//load them sprites;
     _preloader.setContentManager(Content);
     _sceneManager = SceneManager.GetInstance();
     _sceneManager.SetGraphicsDevice(GraphicsDevice);
     // TODO: use this.Content to load your game content here
 }