public void MoveEnemy() { enemyHolder.position += Vector3.right * speedOfEnemies; foreach (Transform enemy in enemyHolder) { if (enemy.position.x < -10.5f || enemy.position.x > 10.5f) { speedOfEnemies = -speedOfEnemies; enemyHolder.position += Vector3.down * 0.5f; return; } float randomN = Random.Range(0.0f, 1.0f); if (randomN > fireRate) { Instantiate(Bullet, enemy.position, RotTransform.rotation); SoundControllerSC.PlaySound("PlayerFire"); } if (enemy.position.y <= -2.2) { GameOver.playerIsDead = true; Time.timeScale = 0; } } if (enemyHolder.childCount <= 1) { restartScene.playerWon = true; } }
public void RestartSceneV() { SoundControllerSC.PlaySound("MenuSelection"); GameOver.playerIsDead = false; Time.timeScale = 1; EnemyDeathCounter.enemyKilled = 0; SceneManager.LoadScene(SceneManager.GetActiveScene().name); }
public void WhenDead() { SoundControllerSC.PlaySound("SpaceExplosion"); }
void OneFingerTouch() { SoundControllerSC.PlaySound("EnemyFire"); shoot.MakeShoot(); }
void shootV() { shoot.MakeShoot(); SoundControllerSC.PlaySound("EnemyFire"); }