Skip to content

Efficiency and readability

Compare
Choose a tag to compare
@max-acc max-acc released this 05 Sep 09:46
· 41 commits to main since this release
5eeaf29

This is the second fully working version of the game Pong, but with improved efficiency and readability. There are also minor improvements referring to game play.
Content:

  • better documentation
  • the variables are better sorted
  • the game Pong has its own function (which will helpful in the future when more games will be added)
  • the bats are printed with only one function (but two to calculate the logic for them)
  • the ball spawns on a random position
  • highscore goes until five and if one player scores five points the game is over (printed message "GO" for "Game Over")
  • the highscore function is better optimized for global usage and more efficient
  • the highscore and the game over will be printed as long as none of the joystick's buttons is pressed