示例#1
0
 void Update()
 {
     // Bass
     if (Input.GetKeyDown("s") || Input.GetKeyDown("d") || Input.GetKeyDown("f"))
     {
         isHitting = true;
         StartCoroutine(Hitting());
         if (Conductor.Instance.CheckHit(NoteType.BASS) == true)
         {
             screenFlash.Flash();
             killable           = true;
             currentKillingType = NoteType.BASS;
         }
     }
     // Treble
     if (Input.GetKeyDown("j") || Input.GetKeyDown("k") || Input.GetKeyDown("l"))
     {
         isHitting = true;
         StartCoroutine(Hitting());
         if (Conductor.Instance.CheckHit(NoteType.TREBLE) == true)
         {
             screenFlash.Flash();
             killable           = true;
             currentKillingType = NoteType.TREBLE;
         }
     }
     else
     {
         isHitting = false;
     }
 }
示例#2
0
        private void ready()
        {
            Debug.Assert(state == GameState.Ready);

            // Reset score
            scoreCounter.Reset();

            // Play reset noise
            whooshSound.Play();

            // Flash screen to hide the UI/backdrop element transitions
            screenFlash.Flash(0.0, 700.0);

            // Reset state of game elements
            bird.Reset();
            obstacles.Reset();

            // Restart the backdrop elements
            groundBackdrop.Start();
            skyBackdrop.Start();

            // Reset the UI elements
            gameOverSprite.Hide();
            logoSprite.Show();
        }
    public void TakeDamage(float damage)
    {
        health.TakeDamage(damage);
        CheckHealth();

        flash.Flash();
    }
示例#4
0
    //OnCollisionEnter will only be called when the other collider has a rigidbody, like our ball has
    private void OnCollisionEnter(Collision c)
    {
        //We know there is only one ScreenFlash script in the scene so its safe to assume the one we get is the one we want
        ScreenFlash flasher = FindObjectOfType(typeof(ScreenFlash)) as ScreenFlash;

        //Start the flash
        flasher.Flash();
    }
示例#5
0
    public override void Die()
    {
        base.Die();

        Player.playerHealth.SetInvulnerable(8);

        ScreenFlash.Flash(0.5f);
        CameraShake.Shake(3f, 1f);

        LevelHandler.ClearEnemiesAndProjectiles();
        spikeContainer.SetActive(false);
        foreach (GameObject g in turrets)
        {
            g.GetComponent <Tile>().isTileEnabled = false;
        }
        turretContainer.SetActive(false);
    }
示例#6
0
    private void SetPhase(int phase)
    {
        curPhase = phase;
        switch (curPhase)
        {
        case 0:
            curEnemySpawn = slime0Prefab;
            break;

        case 1:
            health = phase1Cutoff;
            SetShieldStatus(true);

            ScreenFlash.Flash(0.5f);

            curEnemySpawn = slime1Prefab;
            spikeContainer.SetActive(true);

            break;

        case 2:
            health = phase2Cutoff;
            SetShieldStatus(true);

            ScreenFlash.Flash(0.5f);

            curEnemySpawn = slime2Prefab;
            turretContainer.SetActive(true);
            foreach (GameObject g in turrets)
            {
                g.GetComponent <Tile>().isTileEnabled = true;
            }

            break;
        }
    }
示例#7
0
 public void DoScreenFlash()
 {
     StartCoroutine(_screenFlash.Flash(_redFlashOfDoom));
 }