def main(): boy = Boy() grass = Grass() global running running = True while running: handle_events() for boy in team: team[num].index = num+1 for boy in team: boy.update() clear_canvas() grass.draw() for boy in team: boy.draw() numbers.draw(num+1,740,540) #boy.create_team() update_canvas() delay(0.05) close_canvas()
def draw(): clear_canvas() grass.draw() for boy in team: boy.draw() numbers.draw(num + 1, 740, 540) update_canvas()
def main(): boy = Boy() grass = Grass() global running running = True current_time = get_time() while running: # Game Logic frame_time = get_frame_time() handle_events(frame_time) for boy in team: team[num].index = num + 1 for boy in team: boy.update(frame_time) # Game Rendering clear_canvas() grass.draw() for boy in team: boy.draw() numbers.draw(num + 1, 740, 540) update_canvas() delay(0.07)
def draw(): clear_canvas() grass.draw() for boy in team: boy.draw() numbers.draw(Index + 1, 740, 540) update_canvas() delay(0.05)
def draw(): clear_canvas() grass.draw() if Tboy != None: team[Tboy].draw() for boy in team: boy.draw() numbers.draw(selectedIndex + 1, 740, 540) update_canvas()
def draw(): global chr_st clear_canvas() bg.draw() boy.draw() grass.draw() numbers.draw(0, 740, 540, 1) update_canvas()
def draw(): global chr_st clear_canvas() for boy in team: boy.draw() grass.draw() numbers.draw(0, 740, 540, 1) update_canvas()
def clock(turtles): previous_date = 'HH:MM:SS' numbers.draw_number[':'](6, 25, turtles[2]) numbers.draw_number[':'](6, 25, turtles[5]) while True: next_date = datetime.today().strftime('%H:%M:%S') if previous_date != next_date: numbers.draw(turtles, previous_date, next_date, square_size) previous_date = next_date time.sleep(0.1)
def draw_HP(self): self.back_image.clip_draw(0, 0, 300, 50, 1015 + (35 / 2) * 10, 195, 350, 120) self.image.clip_draw(0, 50, 300, 50, 1015 + (35 / 2) * player_hp, 195, 35 * player_hp, 100) numbers.draw(player_hp, 1200, 245, 0.7) self.back_image.clip_draw_to_origin(0, 0, 300, 50, enemy.x - 55, enemy.y + 67, 100, 30) self.back_image.clip_draw_to_origin(0, 0, 300, 50, gunnerX - 55, gunnerY + 67, 100, 30) self.image.clip_draw_to_origin(0, 50, 300, 50, enemy.x - 55, enemy.y + 70, enemy.hp * 10, 25) self.image.clip_draw_to_origin(0, 50, 300, 50, gunnerX - 55, gunnerY + 70, player_hp * 10, 25)
def enter(): global boy, grass, selectedboy, team, selectboyindex, selectindex,frame_time boy = Boy() grass = Grass() maxboy = 10 selectindex = 0 selectboyindex = 1 #team = [Boy() for i in range(maxboy)] #maxboy 수 만큼 보이들을 생성 team = create_team() selectedboy = team[0] running = True while running: handle_events() frame_time = get_frame_time_rate.FPS() for boy in team: boy.update(frame_time) clear_canvas() grass.draw() numbers.draw(selectindex + 1, 740, 540) for boy in team: boy.draw() for i in range(5): numbers.draw(i+1, team[i].x, team[i].y + 45, 0.3) # 보이들 각자에 그려질 숫자들은 0~ maxboy 까지 였으나 json을 위해 임의로 수정(maxboy->5) update_canvas() delay(0.05) close_canvas()
def draw_EP(self): self.back_image.clip_draw(0, 0, 300, 50, 1015 + (35 / 2) * 10, 95, 350, 120) self.image.clip_draw(0, 0, 300, 50, 1015 + (35 / 2) * player_ep, 95, 35 * player_ep, 100) numbers.draw(player_ep, 1200, 145, 0.7)
if move_point_pop == True: m_cursor.move_point_move() elif attack_point_pop == True: m_cursor.move_point_attack() gunner.draw() enemy.draw() if enemy_hit_trigger == True: UI.hit_on_enemy() elif player_hit_trigger == True: UI.hit_on_player() #UI.draw() numbers.draw(turn, 450, 250, 1) # 턴 나타내는 숫자. 테스트용 if mouse_cursor_change == True: if move == True: m_cursor.move_cursor() elif attack == True: m_cursor.attack_cursor() if end == True: load_image('game_over.png').draw(700, 500) update_canvas() clear_canvas() close_canvas()
def draw(self): self.image.clip_draw(self.frame * 100, self.state * 100, 100, 100,self.x, self.y) numbers.draw(self.index, self.x + 20, self.y - 20, 0.5)
def draw(self): self.image.clip_draw(self.frame * 100, self.state * 100, 100, 100, self.x, self.y) numbers.draw(self.num, self.x + 50, self.y, 0.3)