Codebase list sugar-pippy-activity / 35d15b1
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
4 changed file(s) with 5 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
5353 elif event.type == KEYDOWN:
5454 sys.exit()
5555
56 # fill the screen with white
56 # fill the screen with almost white
5757 screen.fill((250, 250, 250))
5858
5959 # draw the text
3636 if event.type == pygame.QUIT: sys.exit()
3737 elif event.type == pygame.KEYDOWN: sys.exit()
3838
39 # angle and scale the image
39 # rotate and scale the image
4040 newImage = pygame.transform.rotozoom(image, angle, scale)
4141 newImageRect = newImage.get_rect()
4242 newImageRect.centerx = screen.get_rect().centerx
4343 newImageRect.centery = screen.get_rect().centery
4444
45 # display the angled and scaled image
45 # display the rotated and scaled image
4646 screen.fill(bgcolor)
4747 screen.blit(newImage, newImageRect)
4848 pygame.display.flip()
4949
50 # choose a new angle and scale
50 # choose a new rotation angle and scale
5151 angle = angle + 5.0
5252 scale = scale * 0.95
5353
4545 world.mouse_move(event.pos)
4646
4747 # clear display with a color
48 # (red, green, blue), where 0 <= value < 256
4948 screen.fill((80, 160, 240))
5049
5150 # update & draw physics world
6060 draw_tree((width / 2), height - 20, start_length, 0)
6161 pygame.display.flip()
6262
63 # do nothing visible until the escape key is pressed
6364 while pippy.pygame.next_frame():
64 # chill until escape key is pressed
6565 for event in pygame.event.get():
6666 if event.type == QUIT:
6767 sys.exit()