示例#1
0
        protected override void LoadContent()
        {
            _spriteBatch = new SpriteBatch(GraphicsDevice);

            var defaultFont = Content.Load <SpriteFont>("DefaultFont");
            var ryuTexture  = Content.Load <Texture2D>("Ryu Street Fighter 2 SpriteSheet");

            GameTimer = new Timer(Vector2.Zero, defaultFont, Color.White);
            Ryu       = new Ryu(ryuTexture, Vector2.One * 100, Color.White, 1.2f, Vector2.One * 2);
        }
示例#2
0
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.CornflowerBlue);

            // TODO: Add your drawing code here
            _spriteBatch.Begin();

            GameTimer.DrawString(_spriteBatch);
            Ryu.Animate(_spriteBatch);

            _spriteBatch.End();
            base.Draw(gameTime);
        }
示例#3
0
        protected override void Update(GameTime gameTime)
        {
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
            {
                Exit();
            }

            // TODO: Add your update logic here
            GameTimer.Update(gameTime);
            Ryu.Update(gameTime);

            base.Update(gameTime);
        }