/// <summary> /// This is called when the game should draw itself. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.CornflowerBlue); spriteBatch.Begin(); this.dungeonlevel.Draw(spriteBatch); Link.State.Draw(spriteBatch); this.ProjectileFactory.Draw(spriteBatch); headSprite.Draw(Texture2DStorage.HeadExteriorSpriteSheet, spriteBatch, new Vector2(0, 1056)); if (Link.HeartContainer < 8) { for (int i = 0; i < Link.HeartContainer; i++) { EmptyBloodHeartSprite.Draw(Texture2DStorage.GetHeartNoBloodSpriteSheet(), spriteBatch, new Vector2(1056 + 48 * i, 1248)); } } else { for (int k = 0; k < 8; k++) { EmptyBloodHeartSprite.Draw(Texture2DStorage.GetHeartNoBloodSpriteSheet(), spriteBatch, new Vector2(1056 + 48 * k, 1248)); } for (int j = 0; j < Link.HeartContainer - 8; j++) { EmptyBloodHeartSprite.Draw(Texture2DStorage.GetHeartNoBloodSpriteSheet(), spriteBatch, new Vector2(1056 + 48 * j, 1296)); } } if (Link.Life < 16) { if (Link.Life % 2 == 0) { for (int i = 0; i < Link.Life / 2; i++) { FullBloodHeartSprite.Draw(Texture2DStorage.GetHeartFullBloodSpriteSheet(), spriteBatch, new Vector2(1056 + 48 * i, 1248)); } } else { for (int i = 0; i < Link.Life / 2; i++) { FullBloodHeartSprite.Draw(Texture2DStorage.GetHeartFullBloodSpriteSheet(), spriteBatch, new Vector2(1056 + 48 * i, 1248)); } HalfBloodHeartSprite.Draw(Texture2DStorage.GetHeartHalfBloodSpriteSheet(), spriteBatch, new Vector2(1056 + 48 * (Link.Life / 2), 1248)); } } else { if (Link.Life % 2 == 0) { for (int i = 0; i < 8; i++) { FullBloodHeartSprite.Draw(Texture2DStorage.GetHeartFullBloodSpriteSheet(), spriteBatch, new Vector2(1056 + 48 * i, 1248)); } for (int j = 0; j < Link.Life / 2 - 8; j++) { FullBloodHeartSprite.Draw(Texture2DStorage.GetHeartFullBloodSpriteSheet(), spriteBatch, new Vector2(1056 + 48 * j, 1296)); } } else { for (int i = 0; i < Link.Life / 2; i++) { FullBloodHeartSprite.Draw(Texture2DStorage.GetHeartFullBloodSpriteSheet(), spriteBatch, new Vector2(1056 + 48 * i, 1248)); } for (int j = 0; j < Link.Life / 2 - 8; j++) { FullBloodHeartSprite.Draw(Texture2DStorage.GetHeartFullBloodSpriteSheet(), spriteBatch, new Vector2(1056 + 48 * j, 1296)); } HalfBloodHeartSprite.Draw(Texture2DStorage.GetHeartHalfBloodSpriteSheet(), spriteBatch, new Vector2(1056 + 48 * ((Link.Life - 16) / 2), 1296)); } } spriteBatch.DrawString(font, Link.RupeeNumber.ToString(), new Vector2(720, 1210), Color.White, 0, font.MeasureString(Link.RupeeNumber.ToString()), 3.0f, SpriteEffects.None, 1f); spriteBatch.DrawString(font, Link.KeyNumber.ToString(), new Vector2(720, 1310), Color.White, 0, font.MeasureString(Link.KeyNumber.ToString()), 3.0f, SpriteEffects.None, 1f); spriteBatch.DrawString(font, Link.BombNumber.ToString(), new Vector2(720, 1360), Color.White, 0, font.MeasureString(Link.BombNumber.ToString()), 3.0f, SpriteEffects.None, 1f); if (paused) { this.InventoryMenu.Draw(spriteBatch, new Vector2(0, 0)); } if (Link.Life <= 0) { AudioFactory.Instance.StopDungeonBG(); this.GameOver.Draw(spriteBatch); } if (Link.TriforceNumber > 0) { AudioFactory.Instance.StopDungeonBG(); this.GameWin.Draw(spriteBatch); } spriteBatch.End(); base.Draw(gameTime); }