diff --git a/classes/ai.py b/classes/ai.py index 1dce6c5..5737878 100644 --- a/classes/ai.py +++ b/classes/ai.py @@ -73,7 +73,7 @@ class AI: self.saper.move() def way_controls(self): - if len(self.the_way)>0: + if type(self.the_way) is list and len(self.the_way)>0: way = self.the_way.pop(0) if way=="move": self.saper.move() diff --git a/classes/bfs.py b/classes/bfs.py index 89eab00..7aead5a 100644 --- a/classes/bfs.py +++ b/classes/bfs.py @@ -255,4 +255,4 @@ class BFS: counter += 1 x = node.Node(tmp_node, node_[0], node_[1], node_[2]) # action heapq.heappush(fringe, (counter, x)) - self.window.draw_search([self.agent.position_x, self.agent.position_y], [node_[1][0], node_[1][1]]) + self.window.draw_search([self.agent.position_x, self.agent.position_y], [node_[1][0], node_[1][1]], self.agent.current_map.tile_size, self.agent.current_map, self.agent) diff --git a/classes/minesweeper.py b/classes/minesweeper.py index c9e5e87..efa26b4 100644 --- a/classes/minesweeper.py +++ b/classes/minesweeper.py @@ -111,11 +111,12 @@ class Map: #od liczby zależy jaki teren, np. 0 - piasek rng = randrange(10) if ok and rng==0 and not (i<2 and j<3): - matrix[i].append(10) - elif ok and rng>7 and not (i<2 and j<3): - matrix[i].append(5) + + matrix[i].append(10) #kamień + elif ok and rng>8 and not (i<2 and j<3): + matrix[i].append(5) #trawa elif ok and rng<2 and not (i<2 and j<3): - matrix[i].append(0) + matrix[i].append(0) #piasek rand_rotate = 0#randrange(4)*90 if rand_rotate==0 and j+3