Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Code Exploration
Non-Header Files
PongBallController.CS
Purpose & Importance:
Manages the behavior, movement, and interactions of the pong ball in the game.
Important Methods & Variables:
MoveLocal()
: Handles the core movement logic, including scoring, rebounding, and vertical wall collisions.Player.cs
Purpose & Importance:
Manages player attributes, controls, and physics in the game. Serves as the backbone for player interaction.
Important Methods & Variables:
playerData
: Stores data for machine learning and save/loading features.scoreboard
: Manages the player's score.CreateNew()
: Initializes a new player.ScorePoint()
: Adds a point to the scoreboard.ForceMap.cs
Purpose & Importance:
Helps calculate the force/physics of the ball.
Important Methods & Variables:
ApplyAt
: Manages the velocity/collision of the ball & paddle.CalculateRelativeAngle
: Determines the paddle-ball collision angle.IsNormalAngle
: Decides if the collision angle was normal.Header Files
_Pong.cs
Purpose & Importance:
A good storage place for variables to quickly change game logic, rules, and play.
Important Classes & Variables:
GameConstants
: Contains constants like winning score, ball's center, paddle positions.GameCache
: Creates a cache for relevant variables._Pong-GamePlayer.cs
Purpose & Importance:
Unifies player controls and later the data for the AI.
Important Classes & Variables:
PlayerData
: Not implemented yet, but crucial for AI control.PlayerControls
: Synthesizes player controls.PongBall.cs
Purpose & Importance:
Controls logic for scoring and rebounding.
Important Classes & Variables:
Initialize
: Initializes the ball.Serve
: Resets the ball.Destroy Ball
: Removes the sprite.Reset
: Repositions the sprite.Testing
Example #1
MoveLocal
inPongBallController
Example #2
GameConstants
in_Pong
Example #3
ForceMap
Documentation
Non-header files:
Pong with RL/Assets/Source/Scripts/Pong/Ball/PongBallController.cs
Pong with RL/Assets/Source/Scripts/Pong/GamePlayer/Player.cs
Assets/Source/Scripts/Pong/GamePlayer/Force/ForceMap.cs
Header files:
Assets/Source/Scripts/Pong/_Pong.cs
Assets/Source/Scripts/Pong/GamePlayer/_Pong-GamePlayer.cs
Assets/Source/Scripts/Pong/Ball/Pong-Ball.cs