public void Draw(GameTime gameTime) { globals.graphics.GraphicsDevice.BlendState = BlendState.Opaque; globals.graphics.GraphicsDevice.DepthStencilState = DepthStencilState.Default; globals.graphics.GraphicsDevice.SamplerStates[0] = SamplerState.LinearWrap; runner.Draw(cam); }
public void Draw(GameTime gameTime) { globals.graphics.GraphicsDevice.BlendState = BlendState.Opaque; globals.graphics.GraphicsDevice.DepthStencilState = DepthStencilState.Default; globals.graphics.GraphicsDevice.SamplerStates[0] = SamplerState.LinearWrap; runner.Draw(cam); judge.Draw(cam); for (int count = 0; count < ground.Count(); count++) { ground[count].Draw(cam); } globals.spriteBatch.Begin(); if (runner.position.X > judge.position.X && runner.position.Z <= 0) { globals.spriteBatch.Draw(bars, new Rectangle(0, 0, 1024, 100), new Rectangle(0, 45, 254, 159 - 128), Color.LightCyan); globals.spriteBatch.DrawString(minigamefont, "Distance:" + (runner.position.X - judge.position.X) / 10 + "m.", new Vector2(300, 20), Color.Red); } globals.spriteBatch.Draw(bars, new Rectangle(0, 668, 1024, 100), new Rectangle(0, 126, 254, 159 - 128), Color.White); globals.spriteBatch.Draw(bars, new Rectangle(0, 668, (int)(1024 * runspeed), 100), new Rectangle(0, 85, (int)(254 * runspeed), 159 - 128), Color.White); globals.spriteBatch.End(); }