GA skelethon

This commit is contained in:
Mateusz 2020-05-26 21:33:36 +02:00
parent 87a341744c
commit d363120ef4
4 changed files with 24 additions and 6 deletions

View File

@ -0,0 +1,4 @@
from random import random, choice
class GeneticAlgorithm:
pass

View File

@ -0,0 +1,10 @@
from random import randint, sample
from math import sqrt
START_COORD = [(6, 2)]
END_COORD = [(10, 7)]
COORDS = [(12, 2), (16, 2), (17, 5), (14, 7), (17, 17), (13, 17), (5, 15), (2, 9), (8, 5), (11, 10)]
class Traveling:
def __init__(self, coords):
self.coords = coords

View File

@ -44,11 +44,12 @@ class Interactable(Entity):
Player.herbs += 1
print(Player.herbs)
if Player.herbs == 10:
if Player.herbs == 10 and self.classifier == Classifiers.REST:
print("Should reset")
Player.statistics.set_hp(100)
Player.statistics.set_stamina(100)
Player.statistics.set_thirst(0)
Player.statistics.set_hunger(0)
Player.statistics.set_thirst(-100)
Player.statistics.set_hunger(-100)
def __str__(self):
return "Entity - ID:{}, pos:({}x, {}y), {}".format(self.id, self.x, self.y, self.classifier.name)

View File

@ -54,11 +54,14 @@ class Player(Entity):
"""
# looses hunger
self.statistics.set_hunger(1.7)
# self.statistics.set_hunger(1.7)
self.statistics.set_hunger(0.7)
# gets more thirsty
self.statistics.set_thirst(2.2)
# self.statistics.set_thirst(2.2)
self.statistics.set_thirst(1.2)
# gets tired
self.statistics.set_stamina(-1.9)
# self.statistics.set_stamina(-1.9)
self.statistics.set_stamina(-0.9)
def applyTimeFatigue(self):
"""