added extra mover food cost

This commit is contained in:
MaxRobinsonTheGreat
2021-12-19 11:23:02 -06:00
parent 33d62934e7
commit 4706ee9abf
4 changed files with 12 additions and 3 deletions

View File

@@ -47,11 +47,10 @@ class Organism {
// amount of food required before it can reproduce
foodNeeded() {
return this.anatomy.cells.length;
return this.anatomy.is_mover ? this.anatomy.cells.length + Hyperparams.extraMoverFoodCost : this.anatomy.cells.length;
}
lifespan() {
// console.log(Hyperparams.lifespanMultiplier)
return this.anatomy.cells.length * Hyperparams.lifespanMultiplier;
}
@@ -118,7 +117,7 @@ class Organism {
org.species.addPop();
}
}
this.food_collected -= this.foodNeeded();
Math.max(this.food_collected -= this.foodNeeded(), 0);
}