Advertisement
tengely03

Untitled

May 27th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. import pygame
  2.  
  3. pygame.init()
  4.  
  5. BLACK = ( 0, 0, 0)
  6. WHITE = (255, 255, 255)
  7. BLUE = ( 0, 0, 255)
  8. GREEN = ( 0, 255, 0)
  9. RED = (255, 0, 0)
  10.  
  11. size = [600, 600]
  12. screen = pygame.display.set_mode(size)
  13.  
  14. done = False
  15. clock = pygame.time.Clock()
  16. screen.fill(WHITE)
  17.  
  18. while not done:
  19.  
  20. # This limits the while loop to a max of 10 times per second.
  21. # Leave this out and we will use all CPU we can.
  22. clock.tick(10)
  23.  
  24. for event in pygame.event.get(): # User did something
  25. if event.type == pygame.QUIT: # If user clicked close
  26. done = True # Flag that we are done so we exit this loop
  27. x = [10, 10]
  28. y = [10, 280]
  29. for i in range(10):
  30. if i % 3 == 0:
  31. depth = 4
  32. else:
  33. depth = 2
  34. pygame.draw.line(screen, BLACK, x, y, depth)
  35. x[0] = x[0] + 30
  36. y[0] = y[0] + 30
  37. x = [10, 10]
  38. y = [280, 10]
  39. for i in range(10):
  40. if i % 3 == 0:
  41. depth = 4
  42. else:
  43. depth = 2
  44. pygame.draw.line(screen, BLACK, x, y, depth)
  45. x[1] = x[1] + 30
  46. y[1] = y[1] + 30
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement