Advertisement
Guest User

Untitled

a guest
Nov 24th, 2014
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. import pygame
  2. from math import pi
  3.  
  4. pygame.init()
  5. screen = pygame.display.set_mode([1000,1000])
  6. clock = pygame.time.Clock()
  7. done = False
  8.  
  9. while not done:
  10. clock.tick(10)
  11. for event in pygame.event.get():
  12. if event.type == pygame.QUIT:
  13. done = True
  14. screen.fill((0,0,0))
  15.  
  16. # draw first arc just past pi/2 to make sure arc is not cut off by rectangle bounds
  17. pygame.draw.arc(screen, (255,255,255),[100,100,800,800], 9 * pi / 16, 1)
  18.  
  19. # normal, easy, simple, arc does not touch vertical red line as expected
  20. pygame.draw.arc(screen, (255,255,255),[200,200,600,600], 2 * pi, 1)
  21.  
  22. # shorter arc because in my actual code it seems that smaller arcs have larger gaps
  23. # but I can't seem to tell here besides it doesn't connect either
  24. pygame.draw.arc(screen, (255,255,255),[300,300,400,400], 4 * pi / 16, 1)
  25.  
  26. # Horizontal and vertical lines for comparison
  27. pygame.draw.line(screen, (255,0,0), [500,500], [500,0])
  28. pygame.draw.line(screen, (255,0,0), [500,500], [900,500])
  29.  
  30. pygame.display.flip()
  31.  
  32. pygame.quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement