change: Finished MushroomVillage
This includes changes such as putting enemies in levels, adding projectiles, and finalizing the bounces for the moving platforms The cymbal has been implemented, and provides a short immunity to projectiles Every section is playable, and includes a final ending object, although there is no transistion to the level from the previous level yet
This commit is contained in:
@@ -49,6 +49,7 @@ public class PlayerBehavior : MonoBehaviour
|
||||
[Header("Sound")]
|
||||
[SerializeField] public AudioClip footstepSound;
|
||||
[SerializeField] public AudioClip deathSound;
|
||||
[SerializeField] public AudioClip cymbalSound;
|
||||
AudioSource audioSource;
|
||||
|
||||
|
||||
@@ -75,6 +76,10 @@ public class PlayerBehavior : MonoBehaviour
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (this.cymbalActiveTime < 0)
|
||||
{
|
||||
this.gameUI.ToggleCymbal(true);
|
||||
}
|
||||
this.cymbalActiveTime -= Time.deltaTime;
|
||||
|
||||
unlockedTambourine = StateController.Instance.HasTambourine();
|
||||
@@ -145,6 +150,13 @@ public class PlayerBehavior : MonoBehaviour
|
||||
{
|
||||
if (this.playerInput.actions["CymbalCrash"].WasPressedThisFrame())
|
||||
{
|
||||
// Play the sound
|
||||
this.gameUI.ToggleCymbal(false);
|
||||
this.audioSource.clip = cymbalSound;
|
||||
this.audioSource.loop = false;
|
||||
this.audioSource.Play();
|
||||
|
||||
// Set the cymbal active for the equivalent of one second
|
||||
this.cymbalActiveTime = 1;
|
||||
}
|
||||
}
|
||||
@@ -370,7 +382,12 @@ public class PlayerBehavior : MonoBehaviour
|
||||
Destroy(collision.gameObject);
|
||||
if (this.cymbalActiveTime > 0)
|
||||
{
|
||||
Debug.Log("Reflected!");
|
||||
Vector2 projVel = collision.gameObject.GetComponent<Rigidbody2D>().velocity;
|
||||
collision.gameObject.GetComponent<Rigidbody2D>().velocity =
|
||||
new Vector2(
|
||||
-projVel.x,
|
||||
-projVel.y
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user