コード例 #1
0
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.CornflowerBlue);

            _spriteBatch.Begin();

            switch (GameElements.currentState)
            {
            case GameElements.State.Run:
                GameElements.RunDraw(_spriteBatch);
                break;

            case GameElements.State.Highscore:
                GameElements.HighScoreDraw(_spriteBatch);
                break;

            case GameElements.State.Quit:
                this.Exit();
                break;

            case GameElements.State.Meny:
                GameElements.MenyDraw(_spriteBatch);
                break;
            }
            _spriteBatch.End();
            base.Draw(gameTime);
        }
コード例 #2
0
        protected override void LoadContent()
        {
            _spriteBatch = new SpriteBatch(GraphicsDevice);
            GameElements.Loadcontent(Content, Window);

            // TODO: use this.content to load your game content here
        }
コード例 #3
0
        protected override void Update(GameTime gameTime)
        {
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
            {
                this.Exit();
            }
            switch (GameElements.currentState)
            {
            case GameElements.State.Run:
                GameElements.currentState = GameElements.RunUpdate(Content, Window, gameTime);
                break;

            case GameElements.State.Highscore:
                GameElements.currentState = GameElements.HighScoreUpdate();
                break;

            case GameElements.State.Quit:
                this.Exit();
                break;

            default:
                GameElements.currentState =
                    GameElements.MenyUpdate();
                break;
            }

            base.Update(gameTime);
        }
コード例 #4
0
 protected override void Initialize()
 {
     GameElements.currentState = GameElements.State.Meny;
     GameElements.Initialize();
     base.Initialize();
 }