def __init__(self, chest_x, chest_y, bg): self.bg = bg self.x, self.y = chest_x+70, chest_y+40 # 상자 오픈 시 치킨 생성 좌표 조정 self.image = load_image('image\Item\Fire_Book.png') self.fall_speed = 100 self.boy = main_state.get_boy() self.ground = main_state.get_ground()
def __init__(self, chest_x, chest_y, bg): self.bg = bg self.x, self.y = chest_x - 20, chest_y + 10 # 상자 오픈 시 치킨 생성 좌표 조정 self.image = load_image('image\Item\Red_Potion.png') self.fall_speed = 100 self.boy = main_state.get_boy() self.ground = main_state.get_ground()
def do(eru): eru.frame = (eru.frame + FRAMES_PER_ACTION * ACTION_PER_TIME * game_framework.frame_time) \ % FRAMES_PER_ACTION eru.x += eru.velocity * game_framework.frame_time eru.x = clamp(Eru_Size * 0.25, eru.x, game_world.WIDTH - Eru_Size * 0.25) eru.distance += game_framework.frame_time * SPEED_PPS eru.bullet_timer += game_framework.frame_time * 10 if int(eru.bullet_timer) >= 3 - eru.speed_upgrade_value * 0.5: eru.bullet_shoot() eru.bullet_timer = 0 if eru.crash_effect_timer > 0: eru.crash_effect_timer -= game_framework.frame_time if eru.crash_effect_timer > 0.5: eru.eru_crush_sound.play(1) dragons = main_state.get_dragons() ground = main_state.get_ground() if eru.distance >= eru.stage_level * 2500 + 2500 and eru.stage_level < 4: ground.stage_level += 1 eru.stage_level += 1 for dragon in reversed(dragons): if dragon.stage_level < 4: dragon.stage_level = ground.stage_level if eru.gold_count > 0: eru.gold_sound.play(1) eru.gold_count = 0
def enter(): global font bg = main_state.get_ground() bg.bgm.pause() font = load_font('./image/NanumGothicExtraBold.TTF', 30) get_ranking_data() hide_cursor() hide_lattice() print('ranking')
def update(self): eru = main_state.get_eru() bg = main_state.get_ground() self.y -= DRAGON_SPEED_PPS self.frame = (self.frame + FRAMES_PER_ACTION * ACTION_PER_TIME * game_framework.frame_time) % 4 if self.stage_level >= 4 or self.y < -self.size: self.delite() elif collide(eru, self): if eru.crash_effect_timer <= 0 and eru.eternel == 0: eru.remain_hp -= 1 eru.crash_effect_timer = 1 bg.monster_death += 1 self.eraser()
def exit(): bg = main_state.get_ground() bg.bgm.resume()
def __init__(self, chest_x, chest_y): self.x, self.y = chest_x - 20, chest_y + 10 # 상자 오픈 시 치킨 생성 좌표 조정 self.image = load_image('image\chicken.png') self.fall_speed = 100 self.boy = main_state.get_boy() self.ground = main_state.get_ground()