This commit is contained in:
RochesterX
2025-04-18 20:11:19 -04:00
parent a7e181a900
commit ce741c87d5
450 changed files with 59358 additions and 963 deletions

View File

@@ -78,6 +78,7 @@ namespace Game
// Wait for the fall delay before making the platform fall
yield return new WaitForSeconds(fallDelay);
rb.bodyType = RigidbodyType2D.Dynamic;
rb.angularVelocity = Random.Range(-30, 30);
// Wait for the reset delay before resetting the platform
yield return new WaitForSeconds(resetDelay);

View File

@@ -6,6 +6,7 @@ using Music;
using Player;
using UnityEngine.Events;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Controls;
namespace Game
{
@@ -324,12 +325,13 @@ namespace Game
if (gameMode == GameMode.freeForAll)
{
// In free-for-all mode, the last alive player is the winner
GameObject winner = AlivePlayers()[0];
GameObject winner = FindFirstObjectByType<PlayerMovement>().gameObject;//AlivePlayers()[0];
print(winner.name + " is the winner");
// Show the winner's scene and update the win screen
FindFirstObjectByType<PlayerCameraMovement>().WinScene(winner);
WinScreen.Instance.ShowWinScreen(players.IndexOf(winner) + 1);
print($"Player {int.Parse(winner.name)} won");
WinScreen.Instance.ShowWinScreen(int.Parse(winner.name));
// Hide the life display UI
FindFirstObjectByType<LifeDisplayManager>().HideLifeDisplay();

View File

@@ -117,6 +117,7 @@ namespace Game
/// <returns>An IEnumerator for coroutine execution.</returns>
private IEnumerator RespawnHat()
{
lastInteractionTime = Time.time;
// Play the respawn animation
GetComponentInChildren<Animator>().SetTrigger("respawn");
@@ -128,7 +129,6 @@ namespace Game
GetComponent<Rigidbody2D>().linearVelocity = Vector2.zero;
GetComponent<Rigidbody2D>().angularVelocity = 0f;
transform.rotation = Quaternion.identity;
lastInteractionTime = Time.time;
isDropped = false;
}
}