def init(): global logger, screen, clock, resolution, background, camera, stage loadConfigs() logger = outputLogger(" GAME ") logger.info("Initializing.") pygame.init() pygame.display.set_caption("Spellworld") screen = pygame.display.set_mode(resolution) clock = pygame.time.Clock() camera = pygame.Rect(map_size["width"] / 2, map_size["height"] / 2, resolution[0], resolution[1] - ui.height) camera.x -= camera.w / 2 camera.y -= camera.h / 2 stage = pygame.surface.Surface(resolution) rect = pygame.Rect(0, 0, resolution[0], resolution[1] - ui.height) background = stage.subsurface(rect) background.fill(colors.BLUE) aether.init() createPlayer() ui.init() world.init(resolution) pygame.mouse.set_visible(False) mouseInteraction("standard") logger.info("Creating {0} game.".format(resolution))
def init(): global config, background, logger, surface, debug_background config = loadConfig("ui") logger = outputLogger(" UI ") logger.info("Initializing.") rect = pygame.Rect(0, game.resolution[1] - height, game.resolution[0], 220) background = game.stage.subsurface(rect) debug_background = pygame.surface.Surface((960, 140)) debug_background.fill(colors.BLACK) image = pygame.image.load(imagePath("ui_bg.jpg")) background.blit(image, (0, 0)) loadTypography() loadModules()
def init(resolution): global logger logger = outputLogger(" WORLD ") logger.info("Initializing.")