# Jordan Nakamura # 3/8/11 # PyGames lecture import sys from pygame import * from pygame.locals import * from pygame.sprite import * class Probe(Sprite): def __init__(self, x, y): Sprite.__init__(self) self.image = image.load("probe.png") self.rect = self.image.get_rect() # MAIN pygame.init() pygame.display.set_caption('Starcraft II') window = pygame.display.set_mode((600,600)) protoss = Probe(0,0) sprites = Group(protoss) i = 0 while True: print(i) i += 1 # uses event.wait() events = event.wait() if events.type != NOEVENT: if events.type == QUIT: pygame.quit() break # Do this every time to 'flush' the screen window.fill((255,255,255)) sprites.update() sprites.draw(window) display.update()