0

I am trying to create a hitbox around my character, problem is, the images are 158x158px while the character itself is around 66x91px, so instead of creating a rectangle around the character, it creates one around the whole image.

How do I make the rectangle around the character itself?

class Hero(My_Object):
    def __init__(self, screen_width, screen_height, type, x=None, y=None):
        super().__init__(screen_width, screen_height, type, x, y)

        self.image = pygame.image.load('hero/idle/0_Warrior_Idle_Blinking_000.png').convert_alpha()

        self.rect = self.image.get_rect()
    pass

    def show(self, game_display):
        game_display.blit(self.image, self.rect)

This is my character class.

These are the character images

Anyone knows?

0 Answers0