Esempio n. 1
0
        public static void Update(GameTime time)
        {
            KeyboardState key = Keyboard.GetState();
            if (key.IsKeyDown(Keys.OemTilde) == true)
            {
                level.GetCurrentMap().KillSound();
                intro.MusicStart();
                state = State.intro;
                level = new Level(batch, manager, "1-1");
            }

            switch (state)
            {
                case State.intro:
                    intro.Update(time);
                    break;
                case State.info:
                    GameInfoUpdate(time);
                    break;
                case State.level:
                    level.Update(time);
                    break;
                case State.gameover:
                    GameoverUpdate(time);
                    break;
                case State.ending:
                    EndingUpdate(time);
                    break;
                case State.rickroll:
                    RickRollUpdate(time);
                    break;
            }
            GameStateUpdate(time);
        }
Esempio n. 2
0
 public static void Initialize(SpriteBatch batch, ContentManager manager, GraphicsDevice graphics)
 {
     Gamestate.manager = manager;
     Gamestate.batch = batch;
     Gamestate.graphics = graphics;
     font = manager.Load<SpriteFont>("fonts/font");
     font2 = manager.Load<SpriteFont>("fonts/font2");
     intro = new Intro(batch, manager);
     state = State.intro;
     level = new Level(batch, manager, "1-1");
     SoundEffect tmp = manager.Load<SoundEffect>("sounds/gameover");
     gameover = tmp.CreateInstance();
     tmp = manager.Load<SoundEffect>("sounds/cointoscore");
     coinstoscoresound = tmp.CreateInstance();
     coinstoscoresound.IsLooped = true;
     videoPlayer = new VideoPlayer();
     myVideoFile = manager.Load<Video>("videos/Ending");
     myVideoFile2 = manager.Load<Video>("videos/Cat");
 }