minor example fixes following review
Some minor fixes following a review by Sascha Silbe.
Signed-off-by: James Cameron <quozl@laptop.org>
James Cameron
13 years ago
53 | 53 |
elif event.type == KEYDOWN:
|
54 | 54 |
sys.exit()
|
55 | 55 |
|
56 | |
# fill the screen with white
|
|
56 |
# fill the screen with almost white
|
57 | 57 |
screen.fill((250, 250, 250))
|
58 | 58 |
|
59 | 59 |
# draw the text
|
36 | 36 |
if event.type == pygame.QUIT: sys.exit()
|
37 | 37 |
elif event.type == pygame.KEYDOWN: sys.exit()
|
38 | 38 |
|
39 | |
# angle and scale the image
|
|
39 |
# rotate and scale the image
|
40 | 40 |
newImage = pygame.transform.rotozoom(image, angle, scale)
|
41 | 41 |
newImageRect = newImage.get_rect()
|
42 | 42 |
newImageRect.centerx = screen.get_rect().centerx
|
43 | 43 |
newImageRect.centery = screen.get_rect().centery
|
44 | 44 |
|
45 | |
# display the angled and scaled image
|
|
45 |
# display the rotated and scaled image
|
46 | 46 |
screen.fill(bgcolor)
|
47 | 47 |
screen.blit(newImage, newImageRect)
|
48 | 48 |
pygame.display.flip()
|
49 | 49 |
|
50 | |
# choose a new angle and scale
|
|
50 |
# choose a new rotation angle and scale
|
51 | 51 |
angle = angle + 5.0
|
52 | 52 |
scale = scale * 0.95
|
53 | 53 |
|
45 | 45 |
world.mouse_move(event.pos)
|
46 | 46 |
|
47 | 47 |
# clear display with a color
|
48 | |
# (red, green, blue), where 0 <= value < 256
|
49 | 48 |
screen.fill((80, 160, 240))
|
50 | 49 |
|
51 | 50 |
# update & draw physics world
|
60 | 60 |
draw_tree((width / 2), height - 20, start_length, 0)
|
61 | 61 |
pygame.display.flip()
|
62 | 62 |
|
|
63 |
# do nothing visible until the escape key is pressed
|
63 | 64 |
while pippy.pygame.next_frame():
|
64 | |
# chill until escape key is pressed
|
65 | 65 |
for event in pygame.event.get():
|
66 | 66 |
if event.type == QUIT:
|
67 | 67 |
sys.exit()
|