Skip to content

Commit

Permalink
added Prezi link and demo code
Browse files Browse the repository at this point in the history
  • Loading branch information
dtgay committed Apr 11, 2012
1 parent 2895969 commit df0a318
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
36 changes: 36 additions & 0 deletions data/lightning-scripts/bouncy.py
@@ -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()
2 changes: 1 addition & 1 deletion data/lightning.txt
Expand Up @@ -3,4 +3,4 @@ Ross +1
Will +1 Will +1
AJ +1, http://www.csh.rit.edu/~ajman/floss/inform7/Inform7.html#/step-1 AJ +1, http://www.csh.rit.edu/~ajman/floss/inform7/Inform7.html#/step-1
AJ +1, pygame 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.