Esempio n. 1
0
 // Powerup functionality
 private void ActivatePowerup()
 {
     powerupTimer = powerupDuration;
     powerupOn    = true;
     animator.SetBool("powerupOn", true);
     //Debug.Log("Powerup activated");
     //Prevents pizzas from spanwning while in superball mode.
     SpawnObjects.SetCanSpawnFood(false);
     GetComponent <SpriteRenderer> ().sprite   = powerupSprite;
     GetComponent <CircleCollider2D> ().radius = powerupColliderRadius;
     SoundManager.instance.backgroudMusic.Pause();
     SoundManager.instance.superMode.Play();
 }
Esempio n. 2
0
 private void DeactivatePowerup()
 {
     animator.SetBool("powerupOn", false);
     //Debug.Log("Powerup deactivated");
     //Pizzas can spawn again.
     SpawnObjects.SetCanSpawnFood(true);
     GetComponent <SpriteRenderer> ().sprite  = basicSprite;
     GetComponent <CircleCollider2D>().radius = baseColliderRadius;
     //Stop supermode music and resume background music
     SoundManager.instance.superMode.Stop();
     SoundManager.instance.backgroudMusic.Play();
     doubleJumpCount = 0;
     Bounce();  //Exit's rolling with a bounce
     powerupOn = false;
     GameControl.instance.eatFood(0);
 }