Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parker_Jones: PongRL Week 1 #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

parker-boom
Copy link

@parker-boom parker-boom commented Oct 19, 2023

Code Exploration

  • I have looked through all the important sections of the code

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

  • Modification/Addition: Modified MoveLocal in PongBallController
  • Effect: Game intensity increased; paddle always hits the ball if value is too high.

Example #2

  • Modification/Addition: Modified GameConstants in _Pong
  • Effect: Observed ball scaling and positioning effects.

Example #3

  • Modification/Addition: Modified velocity in ForceMap
  • Effect: Not much difference, could be a future way to increase difficulty.

Documentation

Non-header files:

Header files:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant