player can shoot bullet (crashes game when leaving map)
This commit is contained in:
parent
dd6b0fffc1
commit
b10ccf2da8
1 changed files with 230 additions and 98 deletions
13
TanksServer/DrawSteps/BulletDrawer.cs
Normal file
13
TanksServer/DrawSteps/BulletDrawer.cs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
using TanksServer.Helpers;
|
||||
using TanksServer.Services;
|
||||
|
||||
namespace TanksServer.DrawSteps;
|
||||
|
||||
internal sealed class BulletDrawer(BulletManager bullets): IDrawStep
|
||||
{
|
||||
public void Draw(DisplayPixelBuffer buffer)
|
||||
{
|
||||
foreach (var bullet in bullets.GetAll())
|
||||
buffer.Pixels[bullet.Position.ToPixelPosition().GetPixelIndex()] = true;
|
||||
}
|
||||
}
|
||||
Reference in a new issue