private void SwapInvaderSprites() { var invaders = _gameStateProvider.Current.InvaderViews; for (int i = 0; i < invaders.Length; i++) { var invader = invaders[i]; if (invader.IsActive()) { invader.SwapSprite(); if (r.NextDouble() < _firingProbability) { _generateMissile.Generate(invader.GetCurrentPosition(), Vector3.down * 300, MissileType.Invader); } } } }
private void FireMissile() { var firingTransform = _playerView.GetFiringTransform(); _generateMissile.Generate(firingTransform.position, firingTransform.up * firingSpeed, MissileType.Player); }