Pierwsza porcja zdjęć + jeden rodzaj infantry ork
36
agent.py
@ -133,7 +133,7 @@ class Agent(pygame.sprite.Sprite):
|
|||||||
|
|
||||||
hits_archer_ork = pygame.sprite.spritecollide(self, self.game.archer_orks, False)
|
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_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_sauron = pygame.sprite.spritecollide(self, self.game.sauronL, False)
|
||||||
#hits_unknown_mob = pygame.sprite.spritecollide(self, self.game.unknown_mobs, False) #unknown mob
|
#hits_unknown_mob = pygame.sprite.spritecollide(self, self.game.unknown_mobs, False) #unknown mob
|
||||||
#if hits_unknown_mob:
|
#if hits_unknown_mob:
|
||||||
@ -170,22 +170,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
|
||||||
|
|
||||||
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 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
|
||||||
@ -200,6 +185,23 @@ 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()
|
||||||
|
|
||||||
|
'''
|
||||||
|
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
|
||||||
|
'''
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ import pandas as pd
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
# Wczytywanie danych
|
# Wczytywanie danych
|
||||||
nasze_dane = pd.read_csv("data")
|
nasze_dane = pd.read_csv("drzewo_decyzyjne\data")
|
||||||
|
|
||||||
|
|
||||||
# Obliczanie entropii dla całego zbioru danych
|
# Obliczanie entropii dla całego zbioru danych
|
||||||
|
23
main.py
@ -4,7 +4,6 @@ from agent import *
|
|||||||
from map_add_ons import *
|
from map_add_ons import *
|
||||||
from mobs import *
|
from mobs import *
|
||||||
#from unknown_mob import * #unknown mob
|
#from unknown_mob import * #unknown mob
|
||||||
import random
|
|
||||||
from bfs import *
|
from bfs import *
|
||||||
from heapq import *
|
from heapq import *
|
||||||
|
|
||||||
@ -34,7 +33,7 @@ class Game:
|
|||||||
self.grass_sprites = pygame.sprite.LayeredUpdates()
|
self.grass_sprites = pygame.sprite.LayeredUpdates()
|
||||||
self.archer_orks = pygame.sprite.LayeredUpdates()
|
self.archer_orks = pygame.sprite.LayeredUpdates()
|
||||||
self.infantry_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.sauronL = pygame.sprite.LayeredUpdates()
|
||||||
self.flowers = pygame.sprite.LayeredUpdates()
|
self.flowers = pygame.sprite.LayeredUpdates()
|
||||||
self.little_rock_sprites = 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.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.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.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.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.bfs.enemy_cells.append(self.bfs.get_cell_number(self.infantry_ork2.x,self.infantry_ork2.y))
|
||||||
self.sauron = Sauron(self, 1, 10)
|
self.sauron = Sauron(self, 1, 10)
|
||||||
self.bfs.enemy_cells.append(self.bfs.get_cell_number(self.sauron.x,self.sauron.y))
|
self.bfs.enemy_cells.append(self.bfs.get_cell_number(self.sauron.x,self.sauron.y))
|
||||||
self.flower = Health_flower(self, 8,2)
|
self.flower = Health_flower(self, 8,2)
|
||||||
@ -111,20 +110,6 @@ class Game:
|
|||||||
grass_cells = []
|
grass_cells = []
|
||||||
|
|
||||||
|
|
||||||
'''def astar(self):
|
|
||||||
|
|
||||||
|
|
||||||
def function(self):
|
|
||||||
|
|
||||||
|
|
||||||
def cost(self):
|
|
||||||
cost = 0
|
|
||||||
while()
|
|
||||||
'''
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# BFS ALGORITHM
|
|
||||||
cols, rows = 13,12
|
cols, rows = 13,12
|
||||||
def get_circle(x,y):
|
def get_circle(x,y):
|
||||||
return (x * TILE_SIZE + TILE_SIZE//2, y* TILE_SIZE + TILE_SIZE//2), TILE_SIZE//4
|
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)
|
path_true.append(a)
|
||||||
print("path:",path)
|
print("path:",path)
|
||||||
print("path_true:",path_true)
|
print("path_true:",path_true)
|
||||||
bfss.move_agent(path_true)
|
#bfss.move_agent(path_true)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
5
mobs.py
@ -54,7 +54,8 @@ class Infantry_ork(pygame.sprite.Sprite):
|
|||||||
|
|
||||||
self.level = 2
|
self.level = 2
|
||||||
self.damage = 50*self.level
|
self.damage = 50*self.level
|
||||||
|
|
||||||
|
'''
|
||||||
|
|
||||||
class Infantry_ork2(pygame.sprite.Sprite):
|
class Infantry_ork2(pygame.sprite.Sprite):
|
||||||
|
|
||||||
@ -83,7 +84,7 @@ class Infantry_ork2(pygame.sprite.Sprite):
|
|||||||
self.level = 3
|
self.level = 3
|
||||||
self.damage = 50*self.level
|
self.damage = 50*self.level
|
||||||
|
|
||||||
|
'''
|
||||||
class Sauron(pygame.sprite.Sprite):
|
class Sauron(pygame.sprite.Sprite):
|
||||||
|
|
||||||
|
|
||||||
|
BIN
zdjecia/ORK_ARCHER/download (1).jpg
Normal file
After Width: | Height: | Size: 7.5 KiB |
BIN
zdjecia/ORK_ARCHER/download (10).jpg
Normal file
After Width: | Height: | Size: 7.3 KiB |
BIN
zdjecia/ORK_ARCHER/download (11).jpg
Normal file
After Width: | Height: | Size: 6.6 KiB |
BIN
zdjecia/ORK_ARCHER/download (12).jpg
Normal file
After Width: | Height: | Size: 6.8 KiB |
BIN
zdjecia/ORK_ARCHER/download (13).jpg
Normal file
After Width: | Height: | Size: 6.7 KiB |
BIN
zdjecia/ORK_ARCHER/download (14).jpg
Normal file
After Width: | Height: | Size: 7.4 KiB |
BIN
zdjecia/ORK_ARCHER/download (2).jpg
Normal file
After Width: | Height: | Size: 5.7 KiB |
BIN
zdjecia/ORK_ARCHER/download (3).jpg
Normal file
After Width: | Height: | Size: 7.1 KiB |
BIN
zdjecia/ORK_ARCHER/download (4).jpg
Normal file
After Width: | Height: | Size: 4.7 KiB |
BIN
zdjecia/ORK_ARCHER/download (5).jpg
Normal file
After Width: | Height: | Size: 8.4 KiB |
BIN
zdjecia/ORK_ARCHER/download (6).jpg
Normal file
After Width: | Height: | Size: 5.7 KiB |
BIN
zdjecia/ORK_ARCHER/download (7).jpg
Normal file
After Width: | Height: | Size: 6.6 KiB |
BIN
zdjecia/ORK_ARCHER/download (8).jpg
Normal file
After Width: | Height: | Size: 7.5 KiB |
BIN
zdjecia/ORK_ARCHER/download (9).jpg
Normal file
After Width: | Height: | Size: 5.3 KiB |
BIN
zdjecia/ORK_ARCHER/download.jpg
Normal file
After Width: | Height: | Size: 4.0 KiB |
BIN
zdjecia/ORK_ARCHER/images (1).jpg
Normal file
After Width: | Height: | Size: 3.6 KiB |
BIN
zdjecia/ORK_ARCHER/images (10).jpg
Normal file
After Width: | Height: | Size: 6.5 KiB |
BIN
zdjecia/ORK_ARCHER/images (100).jpg
Normal file
After Width: | Height: | Size: 4.6 KiB |
BIN
zdjecia/ORK_ARCHER/images (11).jpg
Normal file
After Width: | Height: | Size: 8.1 KiB |
BIN
zdjecia/ORK_ARCHER/images (12).jpg
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
zdjecia/ORK_ARCHER/images (13).jpg
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
zdjecia/ORK_ARCHER/images (14).jpg
Normal file
After Width: | Height: | Size: 8.8 KiB |
BIN
zdjecia/ORK_ARCHER/images (15).jpg
Normal file
After Width: | Height: | Size: 7.5 KiB |
BIN
zdjecia/ORK_ARCHER/images (16).jpg
Normal file
After Width: | Height: | Size: 6.1 KiB |
BIN
zdjecia/ORK_ARCHER/images (17).jpg
Normal file
After Width: | Height: | Size: 6.6 KiB |
BIN
zdjecia/ORK_ARCHER/images (18).jpg
Normal file
After Width: | Height: | Size: 4.3 KiB |
BIN
zdjecia/ORK_ARCHER/images (19).jpg
Normal file
After Width: | Height: | Size: 4.7 KiB |
BIN
zdjecia/ORK_ARCHER/images (2).jpg
Normal file
After Width: | Height: | Size: 4.9 KiB |
BIN
zdjecia/ORK_ARCHER/images (20).jpg
Normal file
After Width: | Height: | Size: 5.7 KiB |
BIN
zdjecia/ORK_ARCHER/images (21).jpg
Normal file
After Width: | Height: | Size: 5.1 KiB |
BIN
zdjecia/ORK_ARCHER/images (22).jpg
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
zdjecia/ORK_ARCHER/images (23).jpg
Normal file
After Width: | Height: | Size: 6.7 KiB |
BIN
zdjecia/ORK_ARCHER/images (24).jpg
Normal file
After Width: | Height: | Size: 4.6 KiB |
BIN
zdjecia/ORK_ARCHER/images (25).jpg
Normal file
After Width: | Height: | Size: 4.5 KiB |
BIN
zdjecia/ORK_ARCHER/images (26).jpg
Normal file
After Width: | Height: | Size: 4.5 KiB |
BIN
zdjecia/ORK_ARCHER/images (27).jpg
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
zdjecia/ORK_ARCHER/images (28).jpg
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
zdjecia/ORK_ARCHER/images (29).jpg
Normal file
After Width: | Height: | Size: 5.3 KiB |
BIN
zdjecia/ORK_ARCHER/images (3).jpg
Normal file
After Width: | Height: | Size: 5.0 KiB |
BIN
zdjecia/ORK_ARCHER/images (30).jpg
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
zdjecia/ORK_ARCHER/images (31).jpg
Normal file
After Width: | Height: | Size: 7.2 KiB |
BIN
zdjecia/ORK_ARCHER/images (32).jpg
Normal file
After Width: | Height: | Size: 7.8 KiB |
BIN
zdjecia/ORK_ARCHER/images (33) - Copy.jpg
Normal file
After Width: | Height: | Size: 4.9 KiB |
BIN
zdjecia/ORK_ARCHER/images (33).jpg
Normal file
After Width: | Height: | Size: 4.7 KiB |
BIN
zdjecia/ORK_ARCHER/images (34) - Copy.jpg
Normal file
After Width: | Height: | Size: 4.7 KiB |
BIN
zdjecia/ORK_ARCHER/images (34).jpg
Normal file
After Width: | Height: | Size: 7.9 KiB |
BIN
zdjecia/ORK_ARCHER/images (35).jpg
Normal file
After Width: | Height: | Size: 9.6 KiB |
BIN
zdjecia/ORK_ARCHER/images (36).jpg
Normal file
After Width: | Height: | Size: 7.2 KiB |
BIN
zdjecia/ORK_ARCHER/images (37).jpg
Normal file
After Width: | Height: | Size: 6.1 KiB |
BIN
zdjecia/ORK_ARCHER/images (38).jpg
Normal file
After Width: | Height: | Size: 5.3 KiB |
BIN
zdjecia/ORK_ARCHER/images (39).jpg
Normal file
After Width: | Height: | Size: 5.6 KiB |
BIN
zdjecia/ORK_ARCHER/images (4).jpg
Normal file
After Width: | Height: | Size: 9.9 KiB |
BIN
zdjecia/ORK_ARCHER/images (40).jpg
Normal file
After Width: | Height: | Size: 7.2 KiB |
BIN
zdjecia/ORK_ARCHER/images (41).jpg
Normal file
After Width: | Height: | Size: 7.2 KiB |
BIN
zdjecia/ORK_ARCHER/images (42).jpg
Normal file
After Width: | Height: | Size: 8.6 KiB |
BIN
zdjecia/ORK_ARCHER/images (43).jpg
Normal file
After Width: | Height: | Size: 8.8 KiB |
BIN
zdjecia/ORK_ARCHER/images (44).jpg
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
zdjecia/ORK_ARCHER/images (45).jpg
Normal file
After Width: | Height: | Size: 8.7 KiB |
BIN
zdjecia/ORK_ARCHER/images (46).jpg
Normal file
After Width: | Height: | Size: 6.7 KiB |
BIN
zdjecia/ORK_ARCHER/images (47).jpg
Normal file
After Width: | Height: | Size: 9.9 KiB |
BIN
zdjecia/ORK_ARCHER/images (48).jpg
Normal file
After Width: | Height: | Size: 4.1 KiB |
BIN
zdjecia/ORK_ARCHER/images (49).jpg
Normal file
After Width: | Height: | Size: 8.4 KiB |
BIN
zdjecia/ORK_ARCHER/images (5).jpg
Normal file
After Width: | Height: | Size: 5.2 KiB |
BIN
zdjecia/ORK_ARCHER/images (50).jpg
Normal file
After Width: | Height: | Size: 7.8 KiB |
BIN
zdjecia/ORK_ARCHER/images (51).jpg
Normal file
After Width: | Height: | Size: 5.9 KiB |
BIN
zdjecia/ORK_ARCHER/images (52).jpg
Normal file
After Width: | Height: | Size: 6.4 KiB |
BIN
zdjecia/ORK_ARCHER/images (53).jpg
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
zdjecia/ORK_ARCHER/images (54).jpg
Normal file
After Width: | Height: | Size: 5.6 KiB |
BIN
zdjecia/ORK_ARCHER/images (55).jpg
Normal file
After Width: | Height: | Size: 6.0 KiB |
BIN
zdjecia/ORK_ARCHER/images (56).jpg
Normal file
After Width: | Height: | Size: 7.3 KiB |
BIN
zdjecia/ORK_ARCHER/images (57).jpg
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
zdjecia/ORK_ARCHER/images (58).jpg
Normal file
After Width: | Height: | Size: 8.5 KiB |
BIN
zdjecia/ORK_ARCHER/images (59).jpg
Normal file
After Width: | Height: | Size: 5.2 KiB |
BIN
zdjecia/ORK_ARCHER/images (6).jpg
Normal file
After Width: | Height: | Size: 9.6 KiB |
BIN
zdjecia/ORK_ARCHER/images (60).jpg
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
zdjecia/ORK_ARCHER/images (61).jpg
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
zdjecia/ORK_ARCHER/images (62).jpg
Normal file
After Width: | Height: | Size: 5.8 KiB |
BIN
zdjecia/ORK_ARCHER/images (63) - Copy.jpg
Normal file
After Width: | Height: | Size: 7.0 KiB |
BIN
zdjecia/ORK_ARCHER/images (63).jpg
Normal file
After Width: | Height: | Size: 7.0 KiB |
BIN
zdjecia/ORK_ARCHER/images (64) - Copy.jpg
Normal file
After Width: | Height: | Size: 7.3 KiB |
BIN
zdjecia/ORK_ARCHER/images (64).jpg
Normal file
After Width: | Height: | Size: 5.7 KiB |
BIN
zdjecia/ORK_ARCHER/images (65).jpg
Normal file
After Width: | Height: | Size: 9.0 KiB |
BIN
zdjecia/ORK_ARCHER/images (66).jpg
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
zdjecia/ORK_ARCHER/images (67).jpg
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
zdjecia/ORK_ARCHER/images (68).jpg
Normal file
After Width: | Height: | Size: 7.2 KiB |
BIN
zdjecia/ORK_ARCHER/images (69).jpg
Normal file
After Width: | Height: | Size: 8.6 KiB |
BIN
zdjecia/ORK_ARCHER/images (7) - Copy.jpg
Normal file
After Width: | Height: | Size: 3.7 KiB |
BIN
zdjecia/ORK_ARCHER/images (7).jpg
Normal file
After Width: | Height: | Size: 3.7 KiB |
BIN
zdjecia/ORK_ARCHER/images (70).jpg
Normal file
After Width: | Height: | Size: 4.0 KiB |
BIN
zdjecia/ORK_ARCHER/images (71).jpg
Normal file
After Width: | Height: | Size: 4.7 KiB |
BIN
zdjecia/ORK_ARCHER/images (72).jpg
Normal file
After Width: | Height: | Size: 5.4 KiB |
BIN
zdjecia/ORK_ARCHER/images (73) - Copy.jpg
Normal file
After Width: | Height: | Size: 4.2 KiB |