Added player score
This commit is contained in:
@@ -44,8 +44,6 @@ class Player(GameObject):
|
||||
self.points = 0
|
||||
|
||||
def handle_input(self, event:pygame.event.EventType):
|
||||
|
||||
|
||||
if(event.type == pygame.KEYDOWN and event.key == pygame.K_LEFT):
|
||||
self.keymap["left"] = True
|
||||
|
||||
|
||||
5
test.py
5
test.py
@@ -16,6 +16,8 @@ clock = pygame.time.Clock()
|
||||
image_enemy = Utils.load_image("Rastergrafik.png")
|
||||
testimage = Utils.load_image("Rastergrafik.png")
|
||||
|
||||
font1 = pygame.font.SysFont("Arial", 32)
|
||||
|
||||
#testimage.set_colorkey((255,0,255), pygame.RLEACCELOK)
|
||||
|
||||
enemy = GameObject.Enemy("Enemy-1", (screen.get_size()[0]/2) -30,30,35,35, screen, testimage)
|
||||
@@ -116,7 +118,8 @@ while(gamestate):
|
||||
enemy.render(screen)
|
||||
|
||||
|
||||
|
||||
label1 = font1.render(F"Playerscore: {player.points}", True, (255,0,0))
|
||||
screen.blit(label1, (500,500))
|
||||
|
||||
|
||||
#if(mouse_pos <= (image.topleft+image.size) and mouse_pos >= image.topleft):
|
||||
|
||||
Reference in New Issue
Block a user