def clearstage():#스테이지클리어 global state1,CHECK,CRUSHOFF generator.MED() generator.RSC() CHECK = False#플레이어제거 CRUSHOFF=False#충돌제거 player.crushshield()#방패깨기
def check_collision(): global state, CRUSHOFF if CRUSHOFF == True: global SHIELD # 쉴드충돌 for g in gfw.world.objects_at(gfw.layer.shield): if collides_distance(player, g): getitemsound.play() gfw.world.remove((g)) SHIELD = True if SHIELD == True: #쉴드생성 generator.RSC() player.shieldora() if CRUSHOFF == True: for m in gfw.world.objects_at(gfw.layer.meteor): #운석충돌 if collides_distance(player, m): explosionsound.play() gfw.world.remove((m)) dead = player.decrease_life() if dead: #게임오버 end_game() if SHIELD == True: #쉴드부딪히면파괴 player.crushshield() generator.RSM() global HEAD #로켓헤드충돌 for n in gfw.world.objects_at(gfw.layer.rockethead): if collides_distance(player, n): wav_item.play() gfw.world.remove((n)) HEAD = True if HEAD == True: generator.RHC() global HEAD1 #로켓바디 충돌 for c in gfw.world.objects_at(gfw.layer.rocketbody): if collides_distance(player, c): wav_item.play() gfw.world.remove((c)) HEAD1 = True if HEAD1 == True: generator.RBC() global HEAD2 #로켓 왼쪽날개 충돌 for d in gfw.world.objects_at(gfw.layer.rocketleft): if collides_distance(player, d): wav_item.play() gfw.world.remove((d)) HEAD2 = True if HEAD2 == True: generator.RLC() global HEAD3 #로켓 오른쪽날개 충돌 for f in gfw.world.objects_at(gfw.layer.rocketlight): if collides_distance(player, f): wav_item.play() gfw.world.remove((f)) HEAD3 = True if HEAD3 == True: generator.RRC()