SHARE
TWEET

Untitled

a guest Sep 15th, 2019 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. import pygame
  3. from pygame.locals import *
  4. from Box import Box
  5.  
  6. pygame.init()
  7.  
  8. screen = pygame.display.set_mode((680,460),0,32)
  9. box1 = Box((255,0,0),(20,0), 200)
  10. box2 = Box((255,255,0),(40,10), 100)
  11. sprites = pygame.sprite.Group()
  12. sprites.add(box1)
  13. sprites.add(box2)
  14.  
  15. clock = pygame.time.Clock()
  16.  
  17. while True:
  18.     for event in pygame.event.get():
  19.         if event.type == QUIT:
  20.             exit()
  21.     screen.fill((255,255,255))
  22.     time_passed = clock.tick() /1000.0
  23.     sprites.update(time_passed)
  24.     sprites.draw(screen)
  25.     pygame.display.update()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top