Capacitive touch sensing allows detection of human interaction with the circuit without requiring physical touch. The circuit provides some level of detection up to almost a foot away. This detection is accomplished using a modified resistor/capacitor circuit with a single 10 MOhm resistor between two Propeller I/O pins.
The aluminum foil and your body make up the two plates of the capacitor. (Your body also provides some additional resistance and a pseudo ground connection.) The amount of time it takes for the circuit to discharge from a high to a low logic level varies with your proximity to the aluminum foil. But this circuit and code have a twist - we’re using PWM to set a logic level halfway between the Propeller’s high and low values.
The Pong game is one of the earliest arcade-style video games, originally released in 1972 by Atari. It’s a simple, two-dimensional game in which a player uses a paddle to knock a ball off adjacent walls. Pong has a long history with many adaptations for a variety of hardware consoles and platforms. It is among the simplest games to code.
Wikipedia hosts a complete summary of Pong [1] if you're interested in the full history.
Change the difficulty of the game and add sound effects with a piezo speaker. Test the following:
Try modifying your program to change the colors of the game. Do the colors of the paddle, ball, and walls have an effect on gameplay? Is it easier to see the ball, and therefore more likely to hit it, if it is colored differently from the paddle? What if all game components are the same hue?
Links
[1] https://en.wikipedia.org/wiki/Pong