Bricklayer.Client.Entities.Player.Draw C# (CSharp) Method

Draw() public method

public Draw ( SpriteBatch spriteBatch, GameTime gameTime ) : void
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch
gameTime Microsoft.Xna.Framework.GameTime
return void
        public void Draw(SpriteBatch spriteBatch, GameTime gameTime)
        {
            float elapsed = (float)gameTime.ElapsedGameTime.TotalSeconds;

            //Draw godmode glow
            if (Mode == PlayerMode.God)
                spriteBatch.Draw(((Map)Map).godTexture, new Vector2((float)Math.Round(DisplayState.Position.X), (float)Math.Round(DisplayState.Position.Y) - 1) - new Vector2(((Map)Map).godTexture.Width / 2, ((Map)Map).godTexture.Height / 2) + new Vector2(Width / 2, Height / 2), Tint);
            //Draw player body
            spriteBatch.Draw(((Map)Map).bodyTexture, new Vector2((float)Math.Round(DisplayState.Position.X), (float)Math.Round(DisplayState.Position.Y) - 1), Tint);
            //Draw player smiley
            spriteBatch.Draw(((Map)Map).smileySheet, new Vector2((float)Math.Round(DisplayState.Position.X), (float)Math.Round(DisplayState.Position.Y) - 1), (Direction == FacingDirection.Left ? Smiley.LeftSource : Smiley.RightSource), Color.White);

            if (Mode == PlayerMode.Normal)
            {
                //Kinda a "hack fix", but instead of sorting tiles into layers to solve the issue of the "3D" part of the character
                //Being overlayed incorrectly, just draw the top, right, and top right tiles again
                if (((int)DisplayState.Position.Y / Tile.Height) - 1 > 0)
                    Map.Tiles[(int)DisplayState.Position.X / Tile.Width, ((int)DisplayState.Position.Y / Tile.Height) - 1, 1].Draw(spriteBatch, ((Map)Map).tileSheet, Vector2.Zero, (int)DisplayState.Position.X / Tile.Width, ((int)DisplayState.Position.Y / Tile.Height) - 1, 1, true);
                Map.Tiles[((int)DisplayState.Position.X / Tile.Width) + 1, (int)DisplayState.Position.Y / Tile.Height, 1].Draw(spriteBatch, ((Map)Map).tileSheet, Vector2.Zero, ((int)DisplayState.Position.X / Tile.Width) + 1, (int)DisplayState.Position.Y / Tile.Height, 1, true);
                if (((int)DisplayState.Position.Y / Tile.Height) - 1 > 0)
                    Map.Tiles[((int)DisplayState.Position.X / Tile.Width) + 1, ((int)DisplayState.Position.Y / Tile.Height) - 1, 1].Draw(spriteBatch, ((Map)Map).tileSheet, Vector2.Zero, ((int)DisplayState.Position.X / Tile.Width) + 1, ((int)DisplayState.Position.Y / Tile.Height) - 1, 1, true);
            }
            //Draw the player tag above them
            DrawTag(spriteBatch, elapsed);
        }