socket fixes, fix tank jumping
This commit is contained in:
parent
9620703efc
commit
b3dacbd6f6
13 changed files with 44 additions and 46 deletions
|
@ -8,6 +8,6 @@ internal sealed class DrawBulletsStep(BulletManager bullets) : IDrawStep
|
|||
public void Draw(PixelGrid buffer)
|
||||
{
|
||||
foreach (var position in bullets.GetAll().Select(b => b.Position.ToPixelPosition()))
|
||||
buffer[position.X, position.Y] = true;
|
||||
buffer[(ushort)position.X, (ushort)position.Y] = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,8 +17,8 @@ internal sealed class DrawMapStep(MapService map) : IDrawStep
|
|||
for (byte pixelInTileY = 0; pixelInTileY < MapService.TileSize; pixelInTileY++)
|
||||
for (byte pixelInTileX = 0; pixelInTileX < MapService.TileSize; pixelInTileX++)
|
||||
{
|
||||
var position = tile.GetPixelRelative(pixelInTileX, pixelInTileY);
|
||||
buffer[position.X, position.Y] = pixelInTileX % 2 == pixelInTileY % 2;
|
||||
var (x, y) = tile.ToPixelPosition().GetPixelRelative(pixelInTileX, pixelInTileY);
|
||||
buffer[(ushort)x, (ushort)y] = pixelInTileX % 2 == pixelInTileY % 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,8 +40,8 @@ internal sealed class DrawTanksStep : IDrawStep
|
|||
if (!TankSpriteAt(dx, dy, orientation))
|
||||
continue;
|
||||
|
||||
var position = tankPosition.GetPixelRelative(dx, dy);
|
||||
buffer[position.X, position.Y] = true;
|
||||
var (x, y) = tankPosition.GetPixelRelative(dx, dy);
|
||||
buffer[(ushort)x, (ushort)y] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue