reposition tanks on map switch, rework map logic
This commit is contained in:
parent
3d65c81b8b
commit
97144ae3b8
13 changed files with 208 additions and 117 deletions
|
@ -4,7 +4,8 @@ namespace TanksServer.GameLogic;
|
|||
|
||||
internal sealed class SpawnPowerUp(
|
||||
IOptions<GameRules> options,
|
||||
MapEntityManager entityManager
|
||||
MapEntityManager entityManager,
|
||||
EmptyTileFinder emptyTileFinder
|
||||
) : ITickStep
|
||||
{
|
||||
private readonly double _spawnChance = options.Value.PowerUpSpawnChance;
|
||||
|
@ -34,7 +35,8 @@ internal sealed class SpawnPowerUp(
|
|||
_ => null
|
||||
};
|
||||
|
||||
entityManager.SpawnPowerUp(type, magazineType);
|
||||
var position = emptyTileFinder.ChooseEmptyTile().GetCenter().ToFloatPosition();
|
||||
entityManager.SpawnPowerUp(position, type, magazineType);
|
||||
return ValueTask.CompletedTask;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue