feat: sounds effects (click on button, win and death) (#67)

This commit is contained in:
2025-05-16 19:27:38 +02:00
committed by GitHub
parent 2c7a420f90
commit 0b32ce7036
28 changed files with 1265 additions and 63 deletions

View File

@ -1,3 +1,4 @@
using System.IO;
using UnityEngine;
using UnityEngine.SceneManagement;
@ -67,17 +68,6 @@ public class ShipGameMode : IGameMode
public void OnCollisionEnter(Player player, Collision2D collision)
{
if (collision.gameObject.CompareTag("Kill"))
{
SceneManager.LoadScene(SceneManager.GetActiveScene().name);
return;
}
if (collision.gameObject.CompareTag("Win"))
{
SceneManager.LoadScene("HomeScene");
return;
}
float currentAngle = GetCurrentZAngle(player);
float shortestAngle = Mathf.DeltaAngle(currentAngle, 0);
player.Transform.rotation = Quaternion.RotateTowards(player.Transform.rotation, Quaternion.Euler(0, 0, 0), Mathf.Abs(shortestAngle));