Added image for fruits

TODO: Optimize GameObjects class for images and sprites
This commit is contained in:
2024-02-02 13:38:06 +01:00
parent cd6a884ac9
commit d55aac72a6
3 changed files with 7 additions and 2 deletions

View File

@@ -287,16 +287,17 @@ class Fruit(GameObject_new):
"""
class GOIMAGE(GameObject):
def __init__(self, name: str, surface, mainscreensize: tuple, posx_init: int = 0, posy_init: int = 0, move_speed: int = 0, is_player: bool = False, is_rect: bool = True, color: tuple = (0, 0, 0), rect_size: tuple = (10, 10), image=str()) -> None:
super().__init__(name, surface, mainscreensize, posx_init, posy_init, move_speed, is_player, is_rect, color, rect_size, image)
self.__image = pygame.image.load(image).convert()
self.__image = pygame.transform.scale(self.__image, (20, 20))
def move(self):
pass
def draw(self):
surface = self.get_surface()
surface.blit(self.__image, self.get_position())"""
surface.blit(self.__image, self.get_position())