Air Hockey Prototype

2D Gaming p5js Programming

There are two players and goals with the matching player and goal on opposite sides of the screen. Player 1 is moved up, down, left, and right by using the WASD keys and player 2 by the arrow keys. Each time the ball goes into player 1 or 2 goal they score a point. The first to reach five points wins. Each players’ movement is restricted to their half of the screen is a line visually shows this.