Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/data/graphics
diff options
context:
space:
mode:
Diffstat (limited to 'data/graphics')
-rw-r--r--data/graphics/bounce4
-rw-r--r--data/graphics/camera4
-rw-r--r--data/graphics/jump24
-rw-r--r--data/graphics/lines4
-rw-r--r--data/graphics/pong4
5 files changed, 18 insertions, 22 deletions
diff --git a/data/graphics/bounce b/data/graphics/bounce
index 02bc34f..d0bcd3c 100644
--- a/data/graphics/bounce
+++ b/data/graphics/bounce
@@ -1,6 +1,6 @@
# bounce: move some text around the screen
-import sys,pygame
+import pippy, pygame, sys
from pygame.locals import *
from random import *
@@ -44,7 +44,7 @@ textRect = text.get_rect()
textRect.left = 0;
textRect.top = 0;
-while 1:
+while pippy.pygame.next_frame():
for event in pygame.event.get():
if event.type == QUIT:
diff --git a/data/graphics/camera b/data/graphics/camera
index 8a1bbb8..6eea88f 100644
--- a/data/graphics/camera
+++ b/data/graphics/camera
@@ -1,6 +1,6 @@
# image: take a picture
-import sys, pygame, gst, time
+import gst, pippy, pygame, sys, time
from random import *
# XO screen is 1200 by 900
@@ -32,7 +32,7 @@ image = pygame.image.load("/tmp/pippypic.jpg")
angle = 0.0
scale = 2.0
-while 1:
+while pippy.pygame.next_frame():
for event in pygame.event.get():
if event.type == pygame.QUIT: sys.exit()
elif event.type == pygame.KEYDOWN: sys.exit()
diff --git a/data/graphics/jump b/data/graphics/jump
index ed08950..be9b49e 100644
--- a/data/graphics/jump
+++ b/data/graphics/jump
@@ -1,31 +1,27 @@
-def clear_scr():
- print '\x1B[H\x1B[J' # clear screen
-
-def wait():
- import time
- time.sleep(0.1)
+import pippy
for i in xrange(0,50):
- clear_scr()
+ pippy.console.clear()
+ # Note that we have to escape backslashes
print "\\o/"
print "_|_"
print " "
- wait()
+ pippy.wait()
- clear_scr()
+ pippy.console.clear()
print "_o_"
print " | "
print "/ \\"
- wait()
+ pippy.wait()
- clear_scr()
+ pippy.console.clear()
print " o "
print "/|\\"
print "| |"
- wait()
+ pippy.wait()
- clear_scr()
+ pippy.console.clear()
print "_o_"
print " | "
print "/ \\"
- wait()
+ pippy.wait()
diff --git a/data/graphics/lines b/data/graphics/lines
index 682ab37..c0faf93 100644
--- a/data/graphics/lines
+++ b/data/graphics/lines
@@ -1,6 +1,6 @@
# lines: make lots of lines on the screen
-import sys,pygame
+import pippy, pygame, sys
from pygame.locals import *
from random import *
@@ -32,7 +32,7 @@ mvect_end = [choice((-1,1)) * randint(1,3), choice((-1,1)) * randint(1,3)]
color = [randint(0,255), randint(0,255), randint(0,255)]
direction = [choice((-1,1)), choice((-1,1)), choice((-1,1))]
-while 1:
+while pippy.pygame.next_frame():
for event in pygame.event.get():
if event.type == QUIT:
diff --git a/data/graphics/pong b/data/graphics/pong
index 351f7ce..0ce3a9e 100644
--- a/data/graphics/pong
+++ b/data/graphics/pong
@@ -5,7 +5,7 @@
# on the XO, the escape key is the top lefthand key,
# circle with an x in it.
-import sys,pygame
+import pippy, pygame, sys
from pygame.locals import *
from random import *
@@ -50,7 +50,7 @@ textRect = text.get_rect()
textRect.centerx = screen.get_rect().centerx
textRect.centery = screen.get_rect().centery
-while 1:
+while pippy.pygame.next_frame():
# display msg
screen.fill(bgcolor)