Exemplo n.º 1
0
    def __get_animation_image(self) -> Image:
        file_path = self.__IMAGE
        rect = self.__character_chip.get_draw_rect(
            pattern=math.ceil(self.__anime_frame / 2)
        )

        return Image(file_path, area_rect=rect)
Exemplo n.º 2
0
 def __get_image(self, position: (int, int)) -> Image:
     return Image(
         self.__IMAGE,
         position,
         area_rect=self.__CHIP.get_draw_rect(self.__item_type),
         is_absolute_position=True
     )
Exemplo n.º 3
0
    def __get_image(self, index: int, position: (int, int)) -> Image:
        converted_position = self.__game_info.convert_map_to_display(position)

        return Image(
            self.__IMAGE,
            converted_position,
            area_rect=self.__CHIP.get_draw_rect(index)
        )
Exemplo n.º 4
0
    def __get_animation_image(self) -> Image:
        file_path = self.__IMAGE
        rect = self.__character_chip.get_draw_rect(
            self.__get_direction_no(),
            self.__anime_frame
        )

        return Image(file_path, area_rect=rect)
Exemplo n.º 5
0
    def __bom_draw(self):

        mm = self.__map_manager
        game_system = mm.game_system
        timer = game_system.timer
        player_y, player_x = mm.player.map_coordinate
        player_position = mm.game_info.convert_map_to_display(
            (player_x, player_y))
        angle = timer * 90
        scale = timer * 0.25
        x = player_position[0] + 8 - (scale * 16)
        y = player_position[1] + 8 - (scale * 16)

        bom_image = Image("resource/image/bom.png", (x, y),
                          transform=(angle, scale))
        game_system.add_draw_object(bom_image)
Exemplo n.º 6
0
    def draw_title(self):
        game_system = self.__game_system
        game_info = self.__game_info
        hi_score_floor = game_info.hi_score_floor
        timer = game_system.timer

        game_system.fill_display()
        width, height = game_system.get_screen_size()

        title_x = width / 2 - 64
        title_y = height / 2 - 32

        image = Image('resource/image/title.png', (title_x, title_y))
        game_system.add_draw_object(image)

        if hi_score_floor >= 2:
            floor_text = f'HI SCORE : B {hi_score_floor} F'
            game_system.add_draw_object(Text(floor_text, (8, 8), Color.CYAN))

        game_system.add_draw_object(
            Text('Press Space Key', (24, 112), self.__BLINK[timer % 6]))