Exemplo n.º 1
0
 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);
         }
Exemplo n.º 2
0
 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);
 }
Exemplo n.º 3
0
 public void MakeShoot() => BulletsFolder.MakeShoot(Player.Angle, Player.Position);