Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Assets/Source/Scripts/Pong/Ball/PongBall.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
//namespace Pong.Ball;
<<<<<<< HEAD
=======
/// <summary>
/// PongBall: controls the logic for what happens on score and on rebound
/// Initialize: is what happens to the ball when the game begins
/// Serve: happens when the ball intializes/resets
/// Destroy Ball: gets rid of sprite
/// Reset: brings back the spite (repositioned)
/// </summary>

>>>>>>> f106512 (Added summary via comments on headers & other important files)
using Pong.Ball;

using System;
Expand Down Expand Up @@ -102,11 +113,14 @@ public void Initialize(Player server) {

//Debug.Log(angle);
serveAngles.Push((angle, desire));
<<<<<<< HEAD

//TODO: debug
/*if (i == 10) {
break;
}*/
=======
>>>>>>> f106512 (Added summary via comments on headers & other important files)
}

// the Player serving is the one on the offensive
Expand Down
12 changes: 12 additions & 0 deletions Assets/Source/Scripts/Pong/Ball/PongBallController.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
//namespace Pong.Ball;
<<<<<<< HEAD
=======
/// <summary>
/// PongBallController Class: Manages the behavior, movement, and interactions of the pong ball in the game.
/// - MoveLocal(): Handles the core movement logic, including:
/// 1. Scoring: Triggers OnScore() when hitting left/right boundaries.
/// 2. Rebounding: Uses Rebounder's forceMap to change trajectory when colliding with a player's stick.
/// 3. Vertical Wall Collisions: Reverses y-axis velocity when hitting top/bottom walls.
/// </summary>


>>>>>>> f106512 (Added summary via comments on headers & other important files)
using Pong.Ball;

using System;
Expand Down
4 changes: 4 additions & 0 deletions Assets/Source/Scripts/Pong/GameManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ public partial class GameManager : MonoBehaviour
// CONTEXT: public => reference in the Unity Editor
public string player1Name = PlayerData.NO_NAME, player2Name = PlayerData.NO_NAME;
public float playerSpeedVP = 1.00f; // per second; travel 100% vertical screen size in one second
<<<<<<< HEAD
public float ballSpeedVP = 0.45f; // per second; travel 45% horizontal screen size in one second
=======
public float ballSpeedVP = 0.65f; // per second; travel 45% horizontal screen size in one second
>>>>>>> f106512 (Added summary via comments on headers & other important files)
public float ballServeMaxAngle = (3f / 7f) * Mathf.PI;
public float ballBounceMaxAngle = (3f / 7f) * Mathf.PI;
public uint scoreToWin = GameConstants.DEFAULT_WIN_SCORE;
Expand Down
9 changes: 9 additions & 0 deletions Assets/Source/Scripts/Pong/GamePlayer/Force/ForceMap.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
//namespace Pong.GamePlayer.Force;
<<<<<<< HEAD
=======
/// <summary>
/// Pong.GamePlayer.ForceMap: helps calculate the force/physics of the ball
/// ApplyAt: manages the velocity/collision of the ball & paddle
/// CalculateRelativeAngle: determines what angle the paddle hit the ball
/// IsNormalAngle: decides if the angle hit at was normal
/// </summary>
>>>>>>> f106512 (Added summary via comments on headers & other important files)
using Pong.GamePlayer.Force;

using System.Collections;
Expand Down
11 changes: 11 additions & 0 deletions Assets/Source/Scripts/Pong/GamePlayer/Player.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
//namespace Pong.GamePlayer;
<<<<<<< HEAD
=======
///<summary>
/// Player Class: Manages player attributes, controls, and physics in the game. Serves as the backbone for each player's interaction with the game environment.
/// - playerData: Stores data for machine learning and save/loading features.
/// - scoreboard: Manages the player's score.
/// - CreateNew(): Initializes a new player, giving them a name and setting up their paddle and scoreboard.
/// - ScorePoint(): Adds a point to the scoreboard and updates any relevant data.
/// </summary>

>>>>>>> f106512 (Added summary via comments on headers & other important files)
using Pong.GamePlayer;

using System.Collections;
Expand Down
8 changes: 8 additions & 0 deletions Assets/Source/Scripts/Pong/GamePlayer/_Pong-GamePlayer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
<<<<<<< HEAD
// * NAMESPACE HEADER FILE
=======
/// <summary>
/// File seems to unify the player controls, and later the data for the AI
/// PlayerData: not currently implemented but will be crucial later for letting the AI control the paddle
/// PlayerControls: synthesizes the controls for players by deciding what each key decides
/// </summary>
>>>>>>> f106512 (Added summary via comments on headers & other important files)

using System.Collections;
using System.Collections.Generic;
Expand Down
10 changes: 9 additions & 1 deletion Assets/Source/Scripts/Pong/_Pong.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
// * NAMESPACE HEADER FILE

<<<<<<< HEAD

=======
/// <summary>
/// Overall this file is a good storage place for a lot of variables that can be updated to quickly change the game logic, rules, and general play
/// GameConstants: contains constans for winning score, balls center, the position of the paddles
/// GameCache: creates a cache to store relevant variables that can be updated during the game by other classes
/// </summary>
>>>>>>> f106512 (Added summary via comments on headers & other important files)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
Expand Down