Draw() public method

public Draw ( Vector3 player, bool isGun ) : void
player Vector3
isGun bool
return void
Ejemplo n.º 1
0
    protected override void Draw(GameTime gameTime)
    {
        GraphicsDevice.Clear(Color.Black);
        //terrain.Draw(gameTime);     // Draw the terrain
        if (!networkHelper.gameStart)
        {
            spriteBatch.Begin(SpriteBlendMode.Additive, SpriteSortMode.BackToFront, SaveStateMode.SaveState);
            spriteBatch.Draw(splashScreen, new Vector2(0, 0), Color.White);
            spriteBatch.DrawString(Arial, "F1 to sign in", new Vector2(500, 450), Color.Yellow);
            spriteBatch.DrawString(Arial, "F2 to create a session", new Vector2(500, 470), Color.Yellow);
            spriteBatch.DrawString(Arial, "F3 to find session", new Vector2(500, 490), Color.Yellow);
            spriteBatch.DrawString(Arial, networkHelper.Message, new Vector2(300, 570), Color.Yellow);
            spriteBatch.End();

            playerModel.Draw(Player2, false);
            jumpPadModel1.Draw(jumpPadLocation1, false);
            if (bulletPos.Count > 0)
            {
                bulletModel.Draw(bulletPos[0], false);
            }

            gun.Draw(gunPosition, true);
        }

        if (networkHelper.gameStart)
        {
            terrain.Draw(gameTime);     // Draw the terrain
            spriteBatch.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.BackToFront, SaveStateMode.SaveState);
            spriteBatch.DrawString(Arial, p1kills + " VS " + p2kills, new Vector2((graphics.PreferredBackBufferWidth / 2) - 20, 10), Color.White);
            spriteBatch.Draw(ret, new Vector2(400, 300), Color.White);
            spriteBatch.End();
            playerModel.Draw(Player2, false);
            jumpPadModel1.Draw(jumpPadLocation1, false);
            for (int x = 0; x < bulletPos.Count; ++x)
            {
                bulletModel.Draw(bulletPos[x], false);
            }
        }
        base.Draw(gameTime);
    }