Pierwsza porcja zdjęć + jeden rodzaj infantry ork

This commit is contained in:
Weranda 2023-05-27 17:05:45 +02:00
parent a4ece14a16
commit bec4c4e275
442 changed files with 27 additions and 39 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -133,7 +133,7 @@ class Agent(pygame.sprite.Sprite):
hits_archer_ork = pygame.sprite.spritecollide(self, self.game.archer_orks, False)
hits_infantry_ork = pygame.sprite.spritecollide(self, self.game.infantry_orks, False)
hits_infantry_ork2 = pygame.sprite.spritecollide(self, self.game.infantry_orks2, False)
#hits_infantry_ork2 = pygame.sprite.spritecollide(self, self.game.infantry_orks2, False)
hits_sauron = pygame.sprite.spritecollide(self, self.game.sauronL, False)
#hits_unknown_mob = pygame.sprite.spritecollide(self, self.game.unknown_mobs, False) #unknown mob
#if hits_unknown_mob:
@ -170,22 +170,7 @@ class Agent(pygame.sprite.Sprite):
self.game.infantry_ork.kill()
self.get_damage(self.game.infantry_ork.damage)
self.level=self.level+1
if hits_infantry_ork2:
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[5]=self.game.infantry_ork2.y
print(self.game.state)
self.kill()
self.game.new()
else:
self.game.state[4]=self.game.infantry_ork2.x
self.game.state[5]=self.game.infantry_ork2.y
print(self.game.state)
self.game.infantry_ork2.kill()
self.get_damage(self.game.infantry_ork2.damage)
self.level=self.level+1
if hits_sauron:
if self.game.sauron.level > self.level or self.game.sauron.damage > self.current_health:
self.game.state[6]=self.game.sauron.x
@ -200,6 +185,23 @@ class Agent(pygame.sprite.Sprite):
self.game.sauron.kill()
self.level=self.level+1
pygame.quit()
'''
if hits_infantry_ork2:
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[5]=self.game.infantry_ork2.y
print(self.game.state)
self.kill()
self.game.new()
else:
self.game.state[4]=self.game.infantry_ork2.x
self.game.state[5]=self.game.infantry_ork2.y
print(self.game.state)
self.game.infantry_ork2.kill()
self.get_damage(self.game.infantry_ork2.damage)
self.level=self.level+1
'''

View File

@ -2,7 +2,7 @@ import pandas as pd
import numpy as np
# Wczytywanie danych
nasze_dane = pd.read_csv("data")
nasze_dane = pd.read_csv("drzewo_decyzyjne\data")
# Obliczanie entropii dla całego zbioru danych

23
main.py
View File

@ -4,7 +4,6 @@ from agent import *
from map_add_ons import *
from mobs import *
#from unknown_mob import * #unknown mob
import random
from bfs import *
from heapq import *
@ -34,7 +33,7 @@ class Game:
self.grass_sprites = pygame.sprite.LayeredUpdates()
self.archer_orks = pygame.sprite.LayeredUpdates()
self.infantry_orks = pygame.sprite.LayeredUpdates()
self.infantry_orks2 = pygame.sprite.LayeredUpdates()
#self.infantry_orks2 = pygame.sprite.LayeredUpdates()
self.sauronL = pygame.sprite.LayeredUpdates()
self.flowers = pygame.sprite.LayeredUpdates()
self.little_rock_sprites = pygame.sprite.LayeredUpdates()
@ -45,8 +44,8 @@ class Game:
self.bfs.enemy_cells.append(self.bfs.get_cell_number(self.archer_ork.x,self.archer_ork.y))
self.infantry_ork = Infantry_ork(self,10,4)
self.bfs.enemy_cells.append(self.bfs.get_cell_number(self.infantry_ork.x,self.infantry_ork.y))
self.infantry_ork2 = Infantry_ork2(self,6,3)
self.bfs.enemy_cells.append(self.bfs.get_cell_number(self.infantry_ork2.x,self.infantry_ork2.y))
#self.infantry_ork2 = Infantry_ork2(self,6,3)
#self.bfs.enemy_cells.append(self.bfs.get_cell_number(self.infantry_ork2.x,self.infantry_ork2.y))
self.sauron = Sauron(self, 1, 10)
self.bfs.enemy_cells.append(self.bfs.get_cell_number(self.sauron.x,self.sauron.y))
self.flower = Health_flower(self, 8,2)
@ -111,20 +110,6 @@ class Game:
grass_cells = []
'''def astar(self):
def function(self):
def cost(self):
cost = 0
while()
'''
# BFS ALGORITHM
cols, rows = 13,12
def get_circle(x,y):
return (x * TILE_SIZE + TILE_SIZE//2, y* TILE_SIZE + TILE_SIZE//2), TILE_SIZE//4
@ -223,7 +208,7 @@ for i in path:
path_true.append(a)
print("path:",path)
print("path_true:",path_true)
bfss.move_agent(path_true)
#bfss.move_agent(path_true)

View File

@ -54,7 +54,8 @@ class Infantry_ork(pygame.sprite.Sprite):
self.level = 2
self.damage = 50*self.level
'''
class Infantry_ork2(pygame.sprite.Sprite):
@ -83,7 +84,7 @@ class Infantry_ork2(pygame.sprite.Sprite):
self.level = 3
self.damage = 50*self.level
'''
class Sauron(pygame.sprite.Sprite):

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Some files were not shown because too many files have changed in this diff Show More