Ejemplo n.º 1
0
    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);
    }
Ejemplo n.º 3
0
 public void WhenDead()
 {
     SoundControllerSC.PlaySound("SpaceExplosion");
 }
Ejemplo n.º 4
0
 void OneFingerTouch()
 {
     SoundControllerSC.PlaySound("EnemyFire");
     shoot.MakeShoot();
 }
Ejemplo n.º 5
0
 void shootV()
 {
     shoot.MakeShoot();
     SoundControllerSC.PlaySound("EnemyFire");
 }