Добавил систему задач для юнитов, она реализована в методе update класса Creature. Подчистил код, пофиксил по мелочам баги. Остался ещё техдолг Егору и задачи из main.

This commit is contained in:
shiva404
2026-03-05 16:35:08 +03:00
parent dafa95989f
commit 45f2c71cb8
6 changed files with 266 additions and 95 deletions

View File

@@ -4,9 +4,7 @@ import uuid
import random
from dataclasses import dataclass, field
from copy import deepcopy
from collections import defaultdict
from heapq import heappush, heappop
from functools import partial
import pygame
import pygame_gui
@@ -15,12 +13,10 @@ from classes import Rock
from pathfinding.core.grid import Grid
from pathfinding.finder.a_star import AStarFinder
from collections import defaultdict
from heapq import heappush, heappop
from math import sqrt, inf
def path_exists(data, path):
current = data
for key in path:
@@ -371,7 +367,7 @@ def find_way(cells, start, goal):
queue[queue_size] = [nr, nc]
queue_size += 1
print(f"Путь не найден: {start} -> {goal}")
#print(f"Путь не найден: {start} -> {goal}")
return None
def can_move_diagonal(r, c, nr, nc, rocks_only, rows, cols):