update generic power up shape
This commit is contained in:
parent
531a3b5866
commit
bce5b8cfc7
|
@ -4,16 +4,18 @@ namespace TanksServer.Graphics;
|
||||||
|
|
||||||
internal sealed class DrawPowerUpsStep(MapEntityManager entityManager) : IDrawStep
|
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");
|
private readonly Sprite _smartSprite = Sprite.FromImageFile("assets/powerup_smart.png");
|
||||||
|
|
||||||
public void Draw(GamePixelGrid pixels)
|
public void Draw(GamePixelGrid pixels)
|
||||||
{
|
{
|
||||||
foreach (var powerUp in entityManager.PowerUps)
|
foreach (var powerUp in entityManager.PowerUps)
|
||||||
{
|
{
|
||||||
var sprite = _genericSprite;
|
var sprite = powerUp switch
|
||||||
if (powerUp is { Type: PowerUpType.MagazineType, MagazineType: MagazineType.Smart })
|
{
|
||||||
sprite = _smartSprite;
|
{ Type: PowerUpType.MagazineType, MagazineType: MagazineType.Smart } => _smartSprite,
|
||||||
|
_ => _genericSprite
|
||||||
|
};
|
||||||
|
|
||||||
DrawPowerUp(pixels, sprite, powerUp.Bounds.TopLeft);
|
DrawPowerUp(pixels, sprite, powerUp.Bounds.TopLeft);
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 112 B |
BIN
tanks-backend/TanksServer/assets/powerup_generic.png
Normal file
BIN
tanks-backend/TanksServer/assets/powerup_generic.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 113 B |
Loading…
Reference in a new issue