def enter(): gfw.world.init(['bg', 'monster', 'unit', 'unit', "gameclear"]) Monster.load_all_images() Unit.load_all_images() life_gauge.load() gameclear.load() global selectedUnit if load(): unit = gfw.world.object(gfw.layer.unit, 0) else: unit = Unit(1) selectedUnit = unit gfw.world.add(gfw.layer.unit, unit) gfw.world.add(gfw.layer.unit, Unit(1)) gfw.world.add(gfw.layer.unit, Unit(1)) gfw.world.add(gfw.layer.unit, Unit(1)) bg = gobj.ImageObject('background.jpg', (canvas_width // 2, canvas_height // 2)) gfw.world.add(gfw.layer.bg, bg) magic_circle = gobj.ImageObject( 'magic.png', (gobj.magic_circle_pos[0], gobj.magic_circle_pos[1])) gfw.world.add(gfw.layer.bg, magic_circle) global font, font2 font = gfw.font.load(gobj.RES_DIR + '/Sweet_story.otf', 50) font2 = gfw.font.load(gobj.RES_DIR + '/ConsolaMalgun.ttf', 20) global monster_time monster_time = 1 global monster_level monster_level = 1 global monster_level_up_time monster_level_up_time = 50 global unit_time unit_time = 50 global music_bg, end_music music_bg = load_music('res/Track 5.mp3') music_bg.set_volume(10) end_music = load_music('res/Track 26.mp3') end_music.set_volume(10) music_bg.repeat_play()