audio for game over + succing little blobs

This commit is contained in:
cemt1363
2026-06-07 05:35:19 +02:00
parent cd31a32900
commit 0f93d9ab93
15 changed files with 2181 additions and 3 deletions
+5 -2
View File
@@ -23,8 +23,10 @@ public class DamageHandler : MonoBehaviour
public AudioSource speaker;
public AudioClip fallsound;
public AudioClip splashSound;
private void Awake()
private void Awake()
{
rb = GetComponent<Rigidbody2D>();
animator = GetComponent<Animator>();
@@ -101,7 +103,8 @@ public class DamageHandler : MonoBehaviour
if (other.CompareTag("Minidrop"))
{
UpdateHealth(health + 0.2f);
Destroy(other.gameObject);
AudioSource.PlayClipAtPoint(splashSound, Camera.main.transform.position);
Destroy(other.gameObject);
return;
}
}
+7
View File
@@ -11,6 +11,9 @@ public class GameOverScript : MonoBehaviour
[SerializeField]
private float duration = 2.0f;
[SerializeField]
private AudioSource audioSource;
void Start()
{
image.SetActive(false);
@@ -23,6 +26,10 @@ public class GameOverScript : MonoBehaviour
elapsed += Time.deltaTime;
if(elapsed >= duration) {
image.SetActive(true);
if (audioSource != null)
{
audioSource.Play();
}
if (Input.anyKeyDown)
{
SceneManager.LoadScene(0, LoadSceneMode.Single);