Some changes..
This commit is contained in:
5
test.py
5
test.py
@@ -19,7 +19,7 @@ testimage = Utils.load_image("Rastergrafik.png")
|
||||
#testimage.set_colorkey((255,0,255), pygame.RLEACCELOK)
|
||||
|
||||
enemy = GameObject.Enemy("Enemy-1", (screen.get_size()[0]/2) -30,30,35,35, screen, testimage)
|
||||
player = GameObject.Player("TEST", (screen.get_size()[0]/2)-17, screen.get_size()[1]-100, 35, 35, testimage)
|
||||
player = GameObject.Player("Player", screen,(screen.get_size()[0]/2)-17, screen.get_size()[1]-100, 35, 35, testimage)
|
||||
|
||||
|
||||
gamestate = True
|
||||
@@ -47,7 +47,7 @@ while(gamestate):
|
||||
max = tuple(map(lambda i, j : i+j, image.topleft, image.size))
|
||||
#Wenn Mausposition X-Achse innerhalb Anfangsposition+Breite
|
||||
if(mouse_pos[0] <= max[0] and mouse_pos[0] >= image.topleft[0]):
|
||||
#Wenn Mausposition Y-Achse innerhalb Anfangsposition+Höhe
|
||||
#Wenn Mausposition Y-Achse innerhalb Anfangsposition+Höhe
|
||||
if(mouse_pos[1] <= max[1] and mouse_pos[1] >= image.topleft[1]):
|
||||
print("Treffer")
|
||||
pos_x = mouse_pos[0]
|
||||
@@ -67,6 +67,7 @@ while(gamestate):
|
||||
enemy.move(-5)
|
||||
|
||||
enemy.shoot()
|
||||
player.firecontrol(screen)
|
||||
|
||||
player.render(screen)
|
||||
enemy.render(screen)
|
||||
|
||||
Reference in New Issue
Block a user