feat: explosion effect on win and death

This commit is contained in:
2025-05-17 16:04:16 +02:00
parent b48e17882c
commit bfa28a189f
4 changed files with 162 additions and 3 deletions

View File

@ -105,6 +105,7 @@ public class Player : MonoBehaviour
if (collision.gameObject.CompareTag("Kill"))
{
SpriteRenderer.sprite = Resources.Load<Sprite>("Shapes/Explosion");
Time.timeScale = 0;
sfxSource.clip = Resources.Load<AudioClip>(Path.Combine("Sounds", "death"));
sfxSource.Play();
@ -113,6 +114,8 @@ public class Player : MonoBehaviour
if (collision.gameObject.CompareTag("Win"))
{
SpriteRenderer.sprite = Resources.Load<Sprite>("Shapes/Explosion");
Time.timeScale = 0;
sfxSource.clip = Resources.Load<AudioClip>(Path.Combine("Sounds", "win"));
sfxSource.Play();
StartCoroutine(LevelHomeButton.PlaySoundAndLoadScene(sfxSource, "SelectLevelScene"));