Pong

Pong is a simple sports game that simulates table tennis. The game features two paddles and a ball, with the objective being to use the paddles to hit the ball back and forth. The players score points when the opponent fails to return the ball. The first player to reach ten points wins the game.

Goals

  1. Create games using NonBlockingGame
  2. Work with NamedSymbol and NamedColor
  3. Keep score between two players
  4. Simulate the game of pong with paddles and a ball.

Play

Player One: Use the 'W' key to move the paddle up and the 'S' key to move the paddle down. Player Two: Use the 'Up' arrow key to move the paddle up and the 'Down' arrow key to move the paddle down.

Programming

Task 1

Create two players and paddles for the players, and give the paddles movement.

Task 2

Create a ball and give it a random velocity.

Task 3

Write function to keep track of score and update the scoreboard.

Task 4

Write function that gets called once someone gets to 10 points and wins the game.

Task 5

Put everything together to simulate a game of pong.

Help

Java

NonBlocking Games Documentation

NamedColor Documentation

NamedSymbol Documentation

C++

NonBlocking Games Documentation

NamedColor Documentation

NamedSymbol Documentation

Python

NonBlocking Games Documentation

NamedColor Documentation

NamedSymbol Documentation