Pong 1D

Pong (marketed as PONG) is one of the earliest arcade video games, and is a tennis sports game featuring simple two-dimensional graphics. The aim is to defeat an opponent either computer-controlled or a second player by earning a higher score. The game was originally manufactured by Atari Incorporated (Atari), who released it in 1972. Pong was created by Allan Alcorn as a training exercise assigned to him by Atari founder Nolan Bushnell. Bushnell based the idea on an electronic ping-pong game included in the Magnavox Odyssey, which later resulted in a lawsuit against Atari. Surprised by the quality of Alcorn’s work, Atari decided to manufacture the game.


Two players interact with a ball free to move in the interval [0,1] of a 1D coordinate axis. One of the playerscan reverse the velocity by clicking the mouse when the ball hits x=0 and the other at x=1. If the mouse is clicked to early or too late the game ball is lost.


Assume the ball moves with constant speed v. The equation of motion is dx=vdt as long as the ball is inside the interval [0,1]. If x((n+1)dt)<0<x(ndt) or x(ndt)<1<x((n+1)dt, then a player can reverse the direction of motion, by a mouse click.


  • Update position by x^{n+1}=x^n+vdt.
  • Reverse the sign of v by mouse click when x((n+1)dt)<0<x(ndt) or x(ndt)<1<x((n+1)dt.

Demo + Lab

Bouncing ball


  • Given variable speed v(t).
  • Add given force F(t) and update dv=\frac{F}{M}dt, dx=vdt.


\item \hyperref[chaptershortcourse]{Short Course of Calculus.}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s