ScrollingShooter.PlayerShip.Draw C# (CSharp) Méthode

Draw() public méthode

Draw the ship on-screen
public Draw ( float elaspedTime, SpriteBatch spriteBatch ) : void
elaspedTime float The elapsed time
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch An already-initialized spritebatch, ready for Draw() commands
Résultat void
        public override void Draw(float elaspedTime, SpriteBatch spriteBatch)
        {
            if (this.Dead)
                return;

            if (InvincibleTimer > 0 && InvincibleFrame > 0)
                return;

            if ((PowerupType & PowerupType.Railgun) > 0)
                spriteBatch.Draw(spriteSheet, RailgunBounds, railgunSpriteBounds, Color.White);

            spriteBatch.Draw(spriteSheet, Position, spriteBounds[(int)steeringState], Color.White, 0f, new Vector2(Bounds.Width / 2, Bounds.Height / 2), 1f, SpriteEffects.None, LayerDepth);

            // Draw shadow
            spriteBatch.Draw(spriteSheet, new Vector2(20, 100), spriteBounds[(int)steeringState], Color.Black, 0f, new Vector2(Bounds.Width / 2, Bounds.Height / 2), 1f, SpriteEffects.None, LayerDepth);
        }