diff options
author | James Cameron <quozl@laptop.org> | 2010-05-21 09:30:18 (GMT) |
---|---|---|
committer | James Cameron <quozl@laptop.org> | 2010-05-21 09:30:18 (GMT) |
commit | 4a50004aa8f2109e6cff4a082a10581dfee0d540 (patch) | |
tree | 90daf190816ac4a24515b1df907d953a576d2809 /data/graphics/tree | |
parent | 0ce089fc9bb7a9f18f953a32c7195e70a62cf2b1 (diff) |
adapt pippy examples to screen dimensions, dev.laptop.org #9260
Adjust all the examples to work for different screen dimensions, and
briefly fix formatting or style in some of the other code examples.
Yet to be done:
1. slideshow, it finds no objects in journal with MIME type
image/jpeg, and as a result does not show any slides,
2. xolympics, it tests an object location against physics world
coordinates to determine winning condition.
Diffstat (limited to 'data/graphics/tree')
-rw-r--r-- | data/graphics/tree | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/data/graphics/tree b/data/graphics/tree index f4cdae7..e01cf8e 100644 --- a/data/graphics/tree +++ b/data/graphics/tree @@ -1,3 +1,4 @@ +# tree
import pippy, pygame, sys
from pygame.locals import *
@@ -7,17 +8,17 @@ import math # always need to init first thing
pygame.init()
-# XO screen is 1200x900
-size = width, height = 1200, 900
-
# create the window and keep track of the surface
# for drawing into
-screen = pygame.display.set_mode(size)
+screen = pygame.display.set_mode()
+
+# ask for screen's width and height
+width, height = screen.get_size()
# turn off the cursor
pygame.mouse.set_visible(False)
-color = (250,250,250)
+color = (250, 250, 250)
min_factor = 0.8
max_factor = 0.9
start_length = 130
@@ -61,7 +62,7 @@ draw_tree((width / 2), height - 20, start_length, 0) pygame.display.flip()
while pippy.pygame.next_frame():
- # chill until a key is pressed
+ # chill until escape key is pressed
for event in pygame.event.get():
if event.type == QUIT:
sys.exit()
|