def minimal_setup_for_game(): pg.init() font.init_fonts() # Window parameters pg.display.set_mode((MAIN_WIN_WIDTH, MAIN_WIN_HEIGHT)) # Load some data races = Loader.load_races() classes = Loader.load_classes() Character.init_data(races, classes)
def setUpClass(cls): super(TestStartScreen, cls).setUpClass() pg.init() font.init_fonts() cls.save_url = "saves/main_save.xml" cls.level_class = Level cls.buttons = [] cls.buttons.append(Rect(NEW_GAME_BUTTON_POS[0], NEW_GAME_BUTTON_POS[1], BUTTON_SIZE[0], BUTTON_SIZE[1])) cls.buttons.append(Rect(LOAD_GAME_BUTTON_POS[0], LOAD_GAME_BUTTON_POS[1], BUTTON_SIZE[0], BUTTON_SIZE[1])) cls.buttons.append(Rect(OPTIONS_BUTTON_POS[0], NEW_GAME_BUTTON_POS[1], BUTTON_SIZE[0], BUTTON_SIZE[1])) cls.buttons.append(Rect(EXIT_GAME_BUTTON_POS[0], NEW_GAME_BUTTON_POS[1], BUTTON_SIZE[0], BUTTON_SIZE[1])) races = Loader.load_races() classes = Loader.load_classes() Character.init_data(races, classes)
if __name__ == "__main__": from src.constants import * import src.gui.fonts as fonts from src.game_entities.destroyable import Destroyable from src.game_entities.breakable import Breakable from src.game_entities.movable import Movable from src.game_entities.character import Character from src.gui.sidebar import Sidebar from src.scenes.level import Level from src.scenes.startScreen import StartScreen from src.services import loadFromXMLManager as Loader pg.init() # Load fonts fonts.init_fonts() # Window parameters pg.display.set_caption("In the name of the Five Cats") screen = pg.display.set_mode((MAIN_WIN_WIDTH, MAIN_WIN_HEIGHT)) # Load constant sprites Destroyable.init_constant_sprites() Breakable.init_constant_sprites() Movable.init_constant_sprites() Sidebar.init_constant_sprites() Level.init_constant_sprites() # Load some data races = Loader.load_races() classes = Loader.load_classes()