Added comments to everything

This commit is contained in:
djkellerman
2025-04-18 15:54:50 -04:00
parent a0305ea0e9
commit 213bb2d14b
39 changed files with 3166 additions and 1796 deletions

View File

@@ -1,19 +1,33 @@
using UnityEngine; using Game; using Music; using Player;
using UnityEngine;
using Game;
using Music;
using Player;
namespace Game
{
public class ObstacleCourse : MonoBehaviour
{
public static GameObject playerWon;
void OnTriggerEnter2D(Collider2D collision)
/// <summary>
/// This class handles the logic for detecting when a player completes the obstacle course.
/// </summary>
public class ObstacleCourse : MonoBehaviour
{
if (collision.gameObject.CompareTag("Player"))
/// <summary>
/// The player who successfully completes the obstacle course.
/// </summary>
public static GameObject playerWon;
/// <summary>
/// Detects when a player enters the trigger area and ends the game.
/// </summary>
/// <param name="collision">The collider of the object that entered the trigger.</param>
private void OnTriggerEnter2D(Collider2D collision)
{
playerWon = collision.gameObject;
GameManager.Instance.GameOver();
// Check if the object entering the trigger is a player
if (collision.gameObject.CompareTag("Player"))
{
// Set the player who won and trigger the game over logic
playerWon = collision.gameObject;
GameManager.Instance.GameOver();
}
}
}
}
}