protected virtual void OnCollisionEnter(Collision collision)
    {
        if (collision.gameObject.GetComponent <Player>())
        {
            collision.gameObject.GetComponent <Player>().StartRespawnSequence();
            meteorSound.PlayAudioClip();
        }

        this.gameObject.SetActive(false);
    }
Beispiel #2
0
 public virtual void PickUpIcon()
 {
     powerupObtainedSound.PlayAudioClip();
     startShelfTimer = false;
     Destroy(this.transform.GetChild(0).gameObject);
     ActivatePowerup();
 }
Beispiel #3
0
 private void FireLasers()
 {
     canFire = false;
     laserFiring.PlayAudioClip();
     CreateLaser(Laser.LaserPosition.TOP);
     CreateLaser(Laser.LaserPosition.BOTTOM);
 }
    void Start()
    {
        countdown.PlayAudioClip();
        GameManager.Instance.startGametime = false;
        GameManager.Instance.StopPlayerMovement();

        StartCoroutine(DelayLevel());
    }
Beispiel #5
0
    public virtual Missle Shoot(Vector2 direction, float speed)
    {
        missleFireSound.PlayAudioClip();
        Missle b = CreateMissle();

        b.direction = direction;
        b.speed     = speed;
        return(b);
    }
    void OnTriggerEnter(Collider collision)
    {
        rockExplosion.PlayAudioClip();

        //If hit by bullet
        if (collision.gameObject.GetComponent <Bullet>())
        {
            Destroy(this.gameObject);
        }
    }
Beispiel #7
0
 private void StartExplosionCountdown()
 {
     timeUntilExplosion -= Time.deltaTime;
     if (timeUntilExplosion < 0)
     {
         missleExplosionSound.PlayAudioClip();
         PrepareToRemoveObjects();
         DestroyEverything();
         Destroy(this.gameObject);
     }
 }
Beispiel #8
0
    public void SetUpLaserAssault(Player.PlayerIdentity identity, float laserBeamSpeed, float laserLifespan, float topRotation, float bottomRotation)
    {
        playerWhoSpawnedIt  = identity;
        laserSpeed          = laserBeamSpeed;
        laserLife           = laserLifespan;
        topLaserRotation    = topRotation;
        bottomLaserRotation = bottomRotation;

        laserAppear   = AudioManager.Instance.FindAudioClip(AudioManager.SoundName.LaserAssaultAppear);
        laserCharging = AudioManager.Instance.FindAudioClip(AudioManager.SoundName.LaserAssaultCharge);
        laserFiring   = AudioManager.Instance.FindAudioClip(AudioManager.SoundName.LaserAssaultFiring);

        laserAppear.PlayAudioClip();
    }
Beispiel #9
0
    void OnTriggerEnter(Collider collision)
    {
        //print("Red hit");
        //If hit by bullet

        redShieldImpact.PlayAudioClip();

        if (collision.gameObject.GetComponent <Bullet>())
        {
            //print("Bullet Bounce");

            collision.GetComponent <Bullet>().direction.y += .3f * this.GetComponent <DestructableShields>().direction.y;
            collision.GetComponent <Bullet>().direction.x -= collision.GetComponent <Bullet>().direction.x * 1.5f;
        }
    }
Beispiel #10
0
    public void StartMeteorStrike()
    {
        //this method called when player picks up Meteor Strike powerup icon, starts meteor strike

        //takes all spawners in metorSpawner, random generator to decide which get chosen to fire
        //upon each firing, resets timer to 1 second
        //once 12 meteors have been shot, meteor strike ends
        meteorStrikeSound.PlayAudioClip();
        iconPickedUp = true;
        spawnScore++;
        shotTimer = 1;

        int spawnerPicked;

        spawnerPicked = UnityEngine.Random.Range(0, meteorSpawners.Count);
        meteorSpawners[spawnerPicked].GetComponent <MeteorStrikeSpawner>().FireMeteor();
    }
Beispiel #11
0
    void OnTriggerEnter(Collider collision)
    {
        //If hit by bullet
        if (collision.gameObject.GetComponent <Bullet>())
        {
            healthPoints--;
        }
        else if (collision.gameObject.GetComponent <Missle>())
        {
            healthPoints = 0;
        }

        if (healthPoints > 0 && (collision.gameObject.GetComponent <Bullet>() || collision.gameObject.GetComponent <Missle>()))
        {
            shieldImpactSound.PlayAudioClip();
        }
        else if ((collision.gameObject.GetComponent <Bullet>() || collision.gameObject.GetComponent <Missle>()))
        {
            shieldDestructionSound.PlayAudioClip();
        }
    }
Beispiel #12
0
 protected virtual void PlayPowerupSound()
 {
     powerupAppearSound   = AudioManager.Instance.FindAudioClip(AudioManager.SoundName.PowerupAppear);
     powerupObtainedSound = AudioManager.Instance.FindAudioClip(AudioManager.SoundName.PowerupObtained);
     powerupAppearSound.PlayAudioClip();
 }
Beispiel #13
0
 public void StartRespawnSequence()
 {
     respawnTimer = respawnTime;
     state        = PlayerState.RESPAWNING;
     deathSound.PlayAudioClip();
 }
Beispiel #14
0
 public void SpawnLasers()
 {
     laserCharging.PlayAudioClip();
     SpawnLaserGuns(true);
     chargeTimer = true;
 }
 private void PlayGunSound()
 {
     gunSound.PlayAudioClip();
 }