Game State & Fixes
Game State
The game state is an object that controls the state of the game (e.g. the score, the objects in the game). Within it I added the paddles, the left paddle controls (the one the user controls) and the ball. I’ll implement a simple AI for the user to play against, although multiplayer implementation is planned.
Fixes
The collision was really buggy and, when two objects would collide, the velocity in both of the axes would be inverted. I fixed this along with other minor bugs.
Organization
Implemented a constants file from which game constants (canvas width & height, default ball speed, etc.) can be customized.
Log in to leave a comment