Dummyclass for Gameobjects

This commit is contained in:
2024-01-16 21:26:36 +01:00
parent e01d187ea5
commit 410ce9f72b
2 changed files with 25 additions and 2 deletions

View File

@@ -147,6 +147,9 @@ class GameObject():
def get_player_score(self) -> int:
return self.__score
def get_surface(self) -> pygame.Surface:
return self.__surface
def has_follower(self):
return self.__has_follower
@@ -225,4 +228,21 @@ class Player(GameObject):
super().__init__(name, surface, mainscreensize, posx_init, posy_init, move_speed, is_player, is_rect, rect_size)
def user_test_func(self):
pass
pass
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, rect_size: tuple = (10, 10), image=str()) -> None:
super().__init__(name, surface, mainscreensize, posx_init, posy_init, move_speed, is_player, is_rect, rect_size, image)
self.__image = pygame.image.load(image).convert()
def move(self):
pass
def draw(self):
print(self.get_surface())
surface = self.get_surface()
surface.blit(self.__image, self.get_position())
pass