dodanie obróconych zdjęć
This commit is contained in:
parent
53ad6e8ed1
commit
3de4a8966b
Binary file not shown.
28
agent.py
28
agent.py
@ -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))
|
||||||
@ -68,12 +76,12 @@ class Agent(pygame.sprite.Sprite):
|
|||||||
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]:
|
||||||
if self.direction==0 and self.rect.x < 832 - 64:
|
if self.direction==0 and self.rect.x < 832 - 64:
|
||||||
self.x_change += TILE_SIZE/2
|
self.x_change += TILE_SIZE/2
|
||||||
@ -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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user