コード例 #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);
         }
コード例 #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);
 }
コード例 #3
0
 public void MakeShoot() => BulletsFolder.MakeShoot(Player.Angle, Player.Position);