dodanie obróconych zdjęć

This commit is contained in:
Weranda 2023-04-29 13:01:47 +02:00
parent 53ad6e8ed1
commit 3de4a8966b
2 changed files with 17 additions and 13 deletions

Binary file not shown.

View File

@ -20,8 +20,16 @@ class Agent(pygame.sprite.Sprite):
self.y_change = 0 self.y_change = 0
#self.AGENT_IMG = pygame.image.load("./zdjecia/"+self.AGENT_IMAGES[self.direction]+".png") #self.AGENT_IMG = pygame.image.load("./zdjecia/"+self.AGENT_IMAGES[self.direction]+".png")
self.AGENT_IMG = pygame.image.load("./zdjecia/gandalf-dol.png") self.AGENT_IMG_RIGHT = pygame.image.load("./zdjecia/gandalf-prawo.png")
self.AGENT = pygame.transform.scale(self.AGENT_IMG,(64,64)) self.AGENT_RIGHT = pygame.transform.scale(self.AGENT_IMG_RIGHT,(64,64))
self.AGENT_IMG_DOWN = pygame.image.load("./zdjecia/gandalf-dol.png")
self.AGENT_DOWN = pygame.transform.scale(self.AGENT_IMG_DOWN,(64,64))
self.AGENT_IMG_LEFT = pygame.image.load("./zdjecia/gandalf-lewo.png")
self.AGENT_LEFT = pygame.transform.scale(self.AGENT_IMG_LEFT,(64,64))
self.AGENT_IMG_UP = pygame.image.load("./zdjecia/gandalf-gora.png")
self.AGENT_UP = pygame.transform.scale(self.AGENT_IMG_UP,(64,64))
self.AGENT = self.AGENT_RIGHT
self.image = pygame.Surface([self.width, self.height]) self.image = pygame.Surface([self.width, self.height])
self.image.blit(self.AGENT, (0,0)) self.image.blit(self.AGENT, (0,0))
@ -66,12 +74,12 @@ class Agent(pygame.sprite.Sprite):
if keys[pygame.K_LEFT]: if keys[pygame.K_LEFT]:
self.direction=(self.direction-1)%4 self.direction=(self.direction-1)%4
print("DIRECTION: "+self.AGENT_IMAGES[self.direction]) print("DIRECTION: "+self.AGENT_IMAGES[self.direction])
if keys[pygame.K_RIGHT]: if keys[pygame.K_RIGHT]:
self.direction=(self.direction+1)%4 self.direction=(self.direction+1)%4
print("DIRECTION: "+self.AGENT_IMAGES[self.direction]) print("DIRECTION: "+self.AGENT_IMAGES[self.direction])
if keys[pygame.K_UP]: if keys[pygame.K_UP]:
@ -146,8 +154,7 @@ class Agent(pygame.sprite.Sprite):
print(self.game.state) print(self.game.state)
self.get_damage(self.game.archer_ork.damage) self.get_damage(self.game.archer_ork.damage)
self.level=self.level+1 self.level=self.level+1
#zmniejszenie życia o damage moba
#level up
if hits_infantry_ork: if hits_infantry_ork:
if self.game.infantry_ork.level > self.level or self.game.infantry_ork.damage > self.current_health: if self.game.infantry_ork.level > self.level or self.game.infantry_ork.damage > self.current_health:
self.game.state[2]=self.game.infantry_ork.x self.game.state[2]=self.game.infantry_ork.x
@ -162,8 +169,7 @@ class Agent(pygame.sprite.Sprite):
self.game.infantry_ork.kill() self.game.infantry_ork.kill()
self.get_damage(self.game.infantry_ork.damage) self.get_damage(self.game.infantry_ork.damage)
self.level=self.level+1 self.level=self.level+1
#zmniejszenie życia o damage moba
#level up
if hits_infantry_ork2: if hits_infantry_ork2:
if self.game.infantry_ork2.level > self.level or self.game.infantry_ork2.damage > self.current_health: if self.game.infantry_ork2.level > self.level or self.game.infantry_ork2.damage > self.current_health:
self.game.state[4]=self.game.infantry_ork2.x self.game.state[4]=self.game.infantry_ork2.x
@ -178,8 +184,7 @@ class Agent(pygame.sprite.Sprite):
self.game.infantry_ork2.kill() self.game.infantry_ork2.kill()
self.get_damage(self.game.infantry_ork2.damage) self.get_damage(self.game.infantry_ork2.damage)
self.level=self.level+1 self.level=self.level+1
#zmniejszenie życia o damage moba
#level up
if hits_sauron: if hits_sauron:
if self.game.sauron.level > self.level or self.game.sauron.damage > self.current_health: if self.game.sauron.level > self.level or self.game.sauron.damage > self.current_health:
self.game.state[6]=self.game.sauron.x self.game.state[6]=self.game.sauron.x
@ -194,8 +199,7 @@ class Agent(pygame.sprite.Sprite):
self.game.sauron.kill() self.game.sauron.kill()
self.level=self.level+1 self.level=self.level+1
pygame.quit() pygame.quit()
#zmniejszenie życia o damage moba
#level up
def get_damage(self,amount): def get_damage(self,amount):
@ -226,6 +230,6 @@ class Agent(pygame.sprite.Sprite):
self.game.SCREEN.blit(lvlDisplay, (370,780)) self.game.SCREEN.blit(lvlDisplay, (370,780))
# brakuje dodania miejsca w którym agent się leczy
# brakuje schematu przeszukiwania # brakuje schematu przeszukiwania