public void DrawPlayerInfo(GraphicsDevice graphics, int alpha) { graphics.DrawImageAlpha(GameImage.Hud, 32, 32, 2, 0, 8, Settings.SCREEN_HEIGHT - 40, alpha); for (int i = 0; i < 6; i++) { graphics.DrawImageAlpha(GameImage.Hud, 32, 32, 2, 1, 8 + 32 + 32 * i, Settings.SCREEN_HEIGHT - 40, alpha); } graphics.DrawImageAlpha(GameImage.Hud, 32, 32, 2, 2, 8 + 32 + 192, Settings.SCREEN_HEIGHT - 40, alpha); if (player.DrawHealth > 0) { int damageCount = player.DamageCount; graphics.DrawRect(8 + 32, Settings.SCREEN_HEIGHT - 40 + 10, 2 * player.DrawHealth, 1, 255, 128 + damageCount / 2, 128 + damageCount / 2, alpha); graphics.DrawRect(8 + 32, Settings.SCREEN_HEIGHT - 40 + 10 + 1, 2 * player.DrawHealth, 12 - 2, 255, damageCount, damageCount, alpha); graphics.DrawRect(8 + 32, Settings.SCREEN_HEIGHT - 40 + 10 + 11, 2 * player.DrawHealth, 1, 128 + damageCount / 2, damageCount, damageCount, alpha); } if (player.CurrentWeapon != Player.Weapon.Pistol) { graphics.DrawImageAlpha(GameImage.Hud, 96, 32, 3, 0, 8, Settings.SCREEN_HEIGHT - 80, alpha); switch (player.CurrentWeapon) { case Player.Weapon.Machinegun: graphics.DrawImageAlpha(GameImage.Item, 32, 32, 0, 0, 9, Settings.SCREEN_HEIGHT - 80, alpha); break; case Player.Weapon.Rocket: graphics.DrawImageAlpha(GameImage.Item, 32, 32, 2, 0, 9, Settings.SCREEN_HEIGHT - 80, alpha); break; case Player.Weapon.Shotgun: graphics.DrawImageAlpha(GameImage.Item, 32, 32, 1, 0, 9, Settings.SCREEN_HEIGHT - 80, alpha); break; case Player.Weapon.Flamethrower: graphics.DrawImageAlpha(GameImage.Item, 32, 32, 3, 0, 9, Settings.SCREEN_HEIGHT - 80, alpha); break; } } int ammo = player.Ammo; if (ammo / 100 > 0) { DrawNumber(graphics, ammo / 100 % 10, 40, Settings.SCREEN_HEIGHT - 80, alpha, player.AmmoNumColorCount); } if (ammo / 10 > 0) { DrawNumber(graphics, ammo / 10 % 10, 40 + 19, Settings.SCREEN_HEIGHT - 80, alpha, player.AmmoNumColorCount); } if (ammo > 0) { DrawNumber(graphics, ammo % 10, 40 + 19 + 19, Settings.SCREEN_HEIGHT - 80, alpha, player.AmmoNumColorCount); } if (player.AmmoHudColorCount > 0) { graphics.DrawImageAlpha(GameImage.Hud, 96, 32, 3, 1, 8, Settings.SCREEN_HEIGHT - 80, player.AmmoHudColorCount * alpha / 255); } }
public override void Draw(GraphicsDevice graphics) { int drawX = (int)Math.Round(position.X) - game.IntCameraX; int drawY = (int)Math.Round(position.Y) - game.IntCameraY; if (animation < 32) { graphics.DrawRect(drawX - 2, drawY - 512, 4, 512, animation % 2 == 0 ? 255 : 0, 255, 255, 4 * animation); graphics.DrawRect(drawX - 1, drawY - 512, 2, 512, animation % 2 == 0 ? 255 : 0, 255, 255, 8 * animation); } else { graphics.DrawImageAdd(GameImage.OyajiThunder, 32, 512, 0, animation / 2 % 8, drawX - 16, drawY - 512, 255 - 16 * (animation - 32), animation % 2 == 0 ? 255 : 0, 255, 255); } }
public override void Draw(GraphicsDevice graphics) { int drawX = (int)Math.Round(position.X) - game.IntCameraX; int drawY = (int)Math.Round(position.Y) - game.IntCameraY; if (animation < 32) { graphics.DrawRect(drawX - 2, drawY - 512, 4, 512, animation % 2 == 0 ? 255 : 0, 255, 255, 4 * animation); graphics.DrawRect(drawX - 1, drawY - 512, 2, 512, animation % 2 == 0 ? 255 : 0, 255, 255, 8 * animation); } else { graphics.DrawImageAdd(GameImage.OyajiThunder, 32, 512, 0, animation / 2 % 8, drawX - 16, drawY - 512, 255 - 16 * (animation - 32), animation % 2 == 0 ? 255 : 0, 255, 255); } }
public void DrawPlayerInfo(GraphicsDevice graphics, int alpha) { graphics.DrawImageAlpha(GameImage.Hud, 32, 32, 2, 0, 8, Settings.SCREEN_HEIGHT - 40, alpha); for (int i = 0; i < 6; i++) { graphics.DrawImageAlpha(GameImage.Hud, 32, 32, 2, 1, 8 + 32 + 32 * i, Settings.SCREEN_HEIGHT - 40, alpha); } graphics.DrawImageAlpha(GameImage.Hud, 32, 32, 2, 2, 8 + 32 + 192, Settings.SCREEN_HEIGHT - 40, alpha); if (player.DrawHealth > 0) { int damageCount = player.DamageCount; graphics.DrawRect(8 + 32, Settings.SCREEN_HEIGHT - 40 + 10, 2 * player.DrawHealth, 1, 255, 128 + damageCount / 2, 128 + damageCount / 2, alpha); graphics.DrawRect(8 + 32, Settings.SCREEN_HEIGHT - 40 + 10 + 1, 2 * player.DrawHealth, 12 - 2, 255, damageCount, damageCount, alpha); graphics.DrawRect(8 + 32, Settings.SCREEN_HEIGHT - 40 + 10 + 11, 2 * player.DrawHealth, 1, 128 + damageCount / 2, damageCount, damageCount, alpha); } if (player.CurrentWeapon != Player.Weapon.Pistol) { graphics.DrawImageAlpha(GameImage.Hud, 96, 32, 3, 0, 8, Settings.SCREEN_HEIGHT - 80, alpha); switch (player.CurrentWeapon) { case Player.Weapon.Machinegun: graphics.DrawImageAlpha(GameImage.Item, 32, 32, 0, 0, 9, Settings.SCREEN_HEIGHT - 80, alpha); break; case Player.Weapon.Rocket: graphics.DrawImageAlpha(GameImage.Item, 32, 32, 2, 0, 9, Settings.SCREEN_HEIGHT - 80, alpha); break; case Player.Weapon.Shotgun: graphics.DrawImageAlpha(GameImage.Item, 32, 32, 1, 0, 9, Settings.SCREEN_HEIGHT - 80, alpha); break; case Player.Weapon.Flamethrower: graphics.DrawImageAlpha(GameImage.Item, 32, 32, 3, 0, 9, Settings.SCREEN_HEIGHT - 80, alpha); break; } } int ammo = player.Ammo; if (ammo / 100 > 0) { DrawNumber(graphics, ammo / 100 % 10, 40, Settings.SCREEN_HEIGHT - 80, alpha, player.AmmoNumColorCount); } if (ammo / 10 > 0) { DrawNumber(graphics, ammo / 10 % 10, 40 + 19, Settings.SCREEN_HEIGHT - 80, alpha, player.AmmoNumColorCount); } if (ammo > 0) { DrawNumber(graphics, ammo % 10, 40 + 19 + 19, Settings.SCREEN_HEIGHT - 80, alpha, player.AmmoNumColorCount); } if (player.AmmoHudColorCount > 0) { graphics.DrawImageAlpha(GameImage.Hud, 96, 32, 3, 1, 8, Settings.SCREEN_HEIGHT - 80, player.AmmoHudColorCount * alpha / 255); } }