handle speed.
authorBen Doumenc <bdoumenc@gmail.com>
Sat, 31 May 2014 12:56:13 +0000 (14:56 +0200)
committerBen Doumenc <bdoumenc@gmail.com>
Sat, 31 May 2014 12:56:13 +0000 (14:56 +0200)
evolution/main.py
evolution/systems.py

index 7db9a4b..9fa2c29 100644 (file)
@@ -11,6 +11,7 @@ from utils import Clock, Vector
 def generateRandomGenes(entity):
     for g in random.sample(GENES.values(), 3):
         entity.addGene(g())
+    logging.debug("Creation: %s[%s]", entity, entity.getGenes())
     
 
 if __name__ == "__main__":
index d2e97cb..92af5a4 100644 (file)
@@ -47,9 +47,8 @@ class Movement:
         entities = scene.getByType(Scene.Types.ALIVE)
         for e in entities:
             if isValid(e, e.direction):
-                # speed = e.stats.get("speed", 1)
-                speed = 1
-                e.move(e.direction)
+                speed = e.stats.get("speed", 1)
+                e.move(e.direction * speed)
 
     def close(self):
         pass