Beispiel #1
0
        public override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.CornflowerBlue);

            // TODO: Add your drawing code here
            Game.SpriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend, SamplerState.PointClamp);
            Game.SpriteBatch.Draw(_stage.Img, new Vector2(0, 52), new Rectangle(0, 0, 700, 500), Color.White, 0f, new Vector2(0, 0), 1.5f, SpriteEffects.None, 0f);

            //The special feature here is source rectangle, which basically specifies which part of the spritesheet to use foror the sprite.
            _fighter.Draw(Game.SpriteBatch, gameTime);
            _fighter2.Draw(Game.SpriteBatch, gameTime);

            Game.SpriteBatch.DrawString(Game1.GameFont, _fighter.hitbox.Intersects(_stage.hbRect).ToString() + ", (" + _fighter.Position.X + ", " + _fighter.Position.Y + ")", new Vector2(200, 10), Color.Black);

            Game.SpriteBatch.DrawString(Game1.GameFont, Drawer.m.ToString(), new Vector2(600, 10), Color.White);

            Drawer.Draw(Game.SpriteBatch, gameTime);
            _damageOverlay.Draw(Game.SpriteBatch);
            Game.SpriteBatch.End();
        }