This commit is contained in:
Kanewersa 2021-05-24 17:27:49 +02:00
parent 840eab678b
commit 551053fd22
7 changed files with 72 additions and 976 deletions

1040
data.txt

File diff suppressed because it is too large Load Diff

View File

@ -53,7 +53,7 @@ class ResourceGenerator:
resource = world.component_for_entity(resource_ent, ResourceComponent)
inventory = world.component_for_entity(player, InventoryComponent)
answer = decision_tree.predict_answer(resource)
print(answer)
# print(answer)
inventory.add_item(resource.resource_type, 1)
game_map.remove_entity(pos.grid_position)
world.delete_entity(resource_ent, immediate=True)

View File

@ -17,5 +17,4 @@ class ResourceCollectionSystem(esper.Processor):
if collect.action == Action.MOVE:
self.world.remove_component(ent, CollectingResourceComponent)
print("HERE")
self.world.add_component(ent, MovingComponent())

View File

@ -21,7 +21,6 @@ class CollisionSystem(esper.Processor):
vector = Direction.get_vector(pos.direction)
moving.target = tuple(map(operator.add, vector, pos.grid_position))
print(moving.target)
moving.direction_vector = vector
if self.check_collision(moving.target):
self.world.remove_component(ent, MovingComponent)

View File

@ -11,7 +11,6 @@ from survival.systems.input_system import PathfindingComponent
class CollectingResourceComponent:
def __init__(self, action):
self.action = action
print(action)
class PathfindingMovementSystem(esper.Processor):

View File

@ -9,4 +9,3 @@ class TimeSystem(esper.Processor):
if time.timer > 1000:
time.add_time(1)
time.timer = 0
print(time)

View File

@ -3,7 +3,7 @@ import random
def generate_data():
f = open("data.txt", "w")
for i in range(1000):
for i in range(100):
weight = random.randint(0, 11)
eatable = bool(random.randint(0, 1))
toughness = random.randint(0, 3)