update generic power up shape

This commit is contained in:
Vinzenz Schroeter 2024-05-03 16:45:35 +02:00
parent 531a3b5866
commit bce5b8cfc7
3 changed files with 6 additions and 4 deletions

View file

@ -4,16 +4,18 @@ namespace TanksServer.Graphics;
internal sealed class DrawPowerUpsStep(MapEntityManager entityManager) : IDrawStep
{
private readonly Sprite _genericSprite = Sprite.FromImageFile("assets/powerup_explosive.png");
private readonly Sprite _genericSprite = Sprite.FromImageFile("assets/powerup_generic.png");
private readonly Sprite _smartSprite = Sprite.FromImageFile("assets/powerup_smart.png");
public void Draw(GamePixelGrid pixels)
{
foreach (var powerUp in entityManager.PowerUps)
{
var sprite = _genericSprite;
if (powerUp is { Type: PowerUpType.MagazineType, MagazineType: MagazineType.Smart })
sprite = _smartSprite;
var sprite = powerUp switch
{
{ Type: PowerUpType.MagazineType, MagazineType: MagazineType.Smart } => _smartSprite,
_ => _genericSprite
};
DrawPowerUp(pixels, sprite, powerUp.Bounds.TopLeft);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 112 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 B