private void UpdateAllObjects() { foreach (var gameObject in AllGameObjects()) { gameObject.Update(); var isOut = IsOutOfMap(gameObject); if (gameObject is Bullet bullet && bullet.MainVectors.Select(DestroyIfHit).Any(isDestroyed => isOut || isDestroyed)) { BulletsFolder.AddBulletToDelete(bullet); }
public void Start() { EnemySpawner = new EnemySpawner(width, height); Player = new Player(width, height); BulletsFolder = new BulletsFolder(); level = 5; Score = 0; GameStart?.Invoke(); EnemySpawner.CreateAsteroidWave(level); }
public void MakeShoot() => BulletsFolder.MakeShoot(Player.Angle, Player.Position);