Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. import pygame
  2.  
  3. pygame.init()
  4. display = pygame.display.set_mode((400,300))
  5. clock = pygame.time.Clock()
  6.  
  7. class Segment:
  8.  
  9. def __init__(self):
  10. self.original = pygame.Surface((100,100), pygame.SRCALPHA)
  11. self.original.fill((200,200,200))
  12. self.count = 0
  13.  
  14. def update(self):
  15. self.image = pygame.transform.rotate(self.original, self.count)
  16. self.rect = self.image.get_rect(center=display.get_rect().center)
  17. self.count = (self.count + 1) % 360
  18.  
  19.  
  20. segment = Segment()
  21.  
  22. while not pygame.event.peek(pygame.QUIT):
  23. segment.update()
  24. display.fill((10,10,10))
  25. display.blit(segment.image, segment.rect)
  26. pygame.display.flip()
  27. clock.tick(60)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement