Added animations class
Editet readme.md Some changes on mainfile
This commit is contained in:
@@ -42,11 +42,12 @@ class Player(GameObject):
|
||||
def __init__(self, name, screen, pos_x, pos_y, width, height, image=None) -> None:
|
||||
super().__init__(name, pos_x, pos_y, width, height, image)
|
||||
self._speed = 10
|
||||
self.screen = screen
|
||||
self.screen:pygame.Surface = screen
|
||||
self.points = 0
|
||||
self._health = 100
|
||||
self.lifes = 2
|
||||
self.kills = 0
|
||||
self._healthbar = pygame.rect.Rect((15, self.screen.get_size()[1]-50, 100, 20))
|
||||
|
||||
def handle_input(self, event:pygame.event.EventType):
|
||||
if(event.type == pygame.KEYDOWN and event.key == pygame.K_LEFT):
|
||||
@@ -79,7 +80,7 @@ class Player(GameObject):
|
||||
self.pos_y += y
|
||||
|
||||
def move(self, direction):
|
||||
if(direction == "left"):
|
||||
if(direction == "left"):
|
||||
self.pos_x -= self._speed
|
||||
|
||||
if(direction == "right"):
|
||||
|
||||
Reference in New Issue
Block a user