Permalink
Browse files

added Prezi link and demo code

  • Loading branch information...
1 parent 2895969 commit df0a3185dc0cc7c4135889a999461267c207816f @oddshocks oddshocks committed Apr 11, 2012
Showing with 37 additions and 1 deletion.
  1. +36 −0 data/lightning-scripts/bouncy.py
  2. +1 −1 data/lightning.txt
@@ -0,0 +1,36 @@
+#!/usr/bin/env python
+
+import sys, pygame
+
+BLACK = 0, 0, 0
+WHITE = 255, 255, 255
+
+pygame.init()
+screen = pygame.display.set_mode((640, 480))
+pygame.display.set_caption("Bouncy the Box")
+
+clock = pygame.time.Clock()
+
+box_x = 300
+box_dx = 4
+
+while True:
+ clock.tick(50)
+
+ for event in pygame.event.get():
+ if event.type == pygame.QUIT:
+ sys.exit()
+
+ screen.fill(BLACK)
+
+ box_x += box_dx
+ if box_x > 620:
+ box_x = 620
+ box_dx = -4
+ elif box_x <= 0:
+ box_x = 0
+ box_dx = 4
+
+ pygame.draw.rect(screen, WHITE, (box_x, 200, 20, 20))
+
+ pygame.display.flip()
View
@@ -3,4 +3,4 @@ Ross +1
Will +1
AJ +1, http://www.csh.rit.edu/~ajman/floss/inform7/Inform7.html#/step-1
AJ +1, pygame
-David +1, pygame
+David +1, pygame, http://prezi.com/5cy5q8iibxjg/introduction-to-pygame/

0 comments on commit df0a318

Please sign in to comment.