algorithm and movement work
This commit is contained in:
parent
80c72f1ba0
commit
cf0a4be82f
@ -55,13 +55,13 @@ class Player(Entity):
|
||||
"""
|
||||
# looses hunger
|
||||
# self.statistics.set_hunger(1.7)
|
||||
self.statistics.set_hunger(0.7)
|
||||
self.statistics.set_hunger(0.5)
|
||||
# gets more thirsty
|
||||
# self.statistics.set_thirst(2.2)
|
||||
self.statistics.set_thirst(1.2)
|
||||
self.statistics.set_thirst(0.5)
|
||||
# gets tired
|
||||
# self.statistics.set_stamina(-1.9)
|
||||
self.statistics.set_stamina(-0.9)
|
||||
self.statistics.set_stamina(-0.5)
|
||||
|
||||
def applyTimeFatigue(self):
|
||||
"""
|
||||
|
@ -24,6 +24,8 @@ class EventManager:
|
||||
# TODO: Make this not retarded
|
||||
self.turnOff = False
|
||||
|
||||
self.iterator = 0
|
||||
|
||||
# TODO
|
||||
def loadKeyboardSettings(self):
|
||||
pass
|
||||
@ -112,6 +114,12 @@ class EventManager:
|
||||
target = pickEntity(self.player, self.game.map)
|
||||
self.player.gotoToTarget(target, self.game.map)
|
||||
|
||||
if keys[pygame.K_t]:
|
||||
if self.player.movementTarget is None:
|
||||
target = self.game.entityToVisitList[self.iterator]
|
||||
self.player.gotoToTarget(target, self.game.map)
|
||||
self.iterator += 1
|
||||
|
||||
if keys[pygame.K_r]:
|
||||
self.game.map.respawn()
|
||||
|
||||
|
@ -422,9 +422,16 @@ class Game:
|
||||
|
||||
ga = GeneticAlgorithm(firstGeneration, mutationProbability)
|
||||
movementList = ga.listOfTravel()
|
||||
print(movementList)
|
||||
print(type(movementList))
|
||||
print(movementList[0])
|
||||
|
||||
self.entityToVisitList = []
|
||||
for i in movementList:
|
||||
self.entityToVisitList.append(self.map.getEntityOnCoord(i))
|
||||
|
||||
self.entityToVisitList.remove(self.entityToVisitList[0])
|
||||
|
||||
# for i in entityToVisitList:
|
||||
# self.player.gotoToTarget(i, self.map)
|
||||
# print("ile")
|
||||
|
||||
# Start game loop
|
||||
self.mainLoop()
|
||||
|
Loading…
Reference in New Issue
Block a user