Spawn a whole bunch of ships

This commit is contained in:
2021-04-19 19:49:13 +02:00
parent faf3a38e93
commit 7b25154e8e
4 changed files with 54 additions and 4 deletions
+11 -3
View File
@@ -23,15 +23,18 @@ namespace EvilSatellites.Screens
private float Theta = 0;
private Player _player;
private Radar ObjectRadar;
private SatelliteSpawner Spawner;
public void Activate()
{
State = ScreenState.Active;
Player player = new Player(this);
Objects.Add(player);
_player = player;
Satellite prop = new Satellite(this, new Vector3(5000, 5000, 5000));
Objects.Add(prop);
// Satellite prop = new Satellite(this, new Vector3(5000, 5000, 5000));
// Objects.Add(prop);
ObjectRadar = new Radar(_player, this);
Spawner = new SatelliteSpawner(this);
Spawner.Spawn();
return;
}
@@ -83,7 +86,7 @@ namespace EvilSatellites.Screens
private void UpdateRadar()
{
var candidates = objtree.Find(_player.Position, new Vector3(1000, 1000, 1000));
ObjectRadar.Update(candidates);
ObjectRadar.Update(Objects);
}
public void HandleInput(GameTime gameTime, KeyboardState inputs)
@@ -176,6 +179,11 @@ namespace EvilSatellites.Screens
Tolk.Output("Satellites");
}
}
if (Input.IsJustPressed(Keys.O))
{
DavyKager.Tolk.Output(Objects.Count.ToString());
}
}
private void CheckCollisions()