Skip to content

Instantly share code, notes, and snippets.

0x03a68C5299AE579Ae5ace456c162C6a8a785D16A
@jsecretan
jsecretan / PiPong.py
Created March 1, 2013 03:29
Some python code that I stole, I mean put together, from a couple of different sources, including: http://www.linuxuser.co.uk/tutorials/make-a-game-on-raspberry-pi and http://ideamonk.blogspot.com/2010/03/fun-with-pygames-camera-module.html This will let you play pong with a raspberry pi / camera setup which will track your white socks on the fl…
#!/usr/bin/env python
# PiPong - A remake of the classic Pong game using PyGame. Written by
# Liam Fraser - 28/07/2012 for the Linux User & Developer magazine.
# Modified by Jimmy Secretan in 12/2012 to use the pygame camera module to track white socks
import pygame # Provides what we need to make a game
import sys # Gives us the sys.exit function to close our program
import random # Can generate random positions for the pong ball
import pygame.camera