def loadLevel(self,levelnum): self.level = levelloader.loadLevel(levelnum) self.level["game"] = self self.keylisteners = [] self.level["exit"] = None gos = self.level["gameobjects"] for go in gos: go.init(self.level)
screen.blit(text, (x,HEIGHT/2-18)) pygame.display.flip() time.sleep(blinktime) clock = pygame.time.Clock() classfactory.startWorkingDay() if __name__ == '__main__': level = 1 mobgroup = pygame.sprite.RenderPlain() playergroup = pygame.sprite.RenderPlain() bulletgroup = pygame.sprite.RenderPlain() mobs = levelloader.loadLevel(level) mobgroup.add(mobs) ship = moreclasses.Ship(WIDTH,HEIGHT) playergroup.add(ship) walls = (Entity.Invisible(pygame.rect.Rect(0,0,1,HEIGHT)),Entity.Invisible(pygame.rect.Rect(WIDTH,0,1,HEIGHT))) endwall = Entity.Invisible(pygame.rect.Rect(0,HEIGHT-ship.rect.h,WIDTH,70)) black = 0, 0, 0 pygame.init() screen = pygame.display.set_mode((WIDTH,HEIGHT)) stillplaying = True won = False while stillplaying: