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/lines | |
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/lines')
-rw-r--r-- | data/graphics/lines | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/data/graphics/lines b/data/graphics/lines index c0faf93..bb67a34 100644 --- a/data/graphics/lines +++ b/data/graphics/lines @@ -4,9 +4,6 @@ import pippy, pygame, sys from pygame.locals import * from random import * -# XO screen is 1200x900 -size = width, height = 1200, 900 - # always need to init first thing pygame.init() @@ -15,7 +12,11 @@ pygame.mouse.set_visible(False) # 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 +size = width, height = screen.get_size() + # start the screen all black screen.fill((0,0,0)) @@ -48,7 +49,7 @@ while pippy.pygame.next_frame(): pygame.display.flip() # update the end points and the color - for i in range(2): + for i in range(2): start[i] = start[i] + mvect_start[i] end[i] = end[i] + mvect_end[i] |