/// <inheritdoc /> public override void Draw(GameTime gameTime) { Game.Background = Color.Black; GraphicsDevice.DepthStencilState = DepthStencilState.Default; Floor.Draw(FloorWorld, Camera.View, Camera.Projection); BoxesWorld.ForEach(boxWorld => Box.Draw(boxWorld, Camera.View, Camera.Projection)); SpheresWorld.ForEach(sphereWorld => Sphere.Draw(sphereWorld, Camera.View, Camera.Projection)); base.Draw(gameTime); }
/// <inheritdoc /> public override void Draw(GameTime gameTime) { Game.Background = Color.Black; GraphicsDevice.DepthStencilState = DepthStencilState.Default; TilingEffect.Parameters["WorldViewProjection"].SetValue(FloorWorld * Camera.View * Camera.Projection); Floor.Draw(TilingEffect); BoxesWorld.ForEach(boxWorld => Box.Draw(boxWorld, Camera.View, Camera.Projection)); SpheresWorld.ForEach(sphereWorld => Sphere.Draw(sphereWorld, Camera.View, Camera.Projection)); Game.SpriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.Opaque, SamplerState.PointClamp, DepthStencilState.Default, RasterizerState.CullCounterClockwise); Game.SpriteBatch.DrawString(SpriteFont, "Launch spheres with the 'Z' key.", new Vector2(GraphicsDevice.Viewport.Width - 400, 0), Color.White); Game.SpriteBatch.End(); base.Draw(gameTime); }