Added final touches

This commit is contained in:
MaxRobinsonTheGreat
2020-08-27 14:54:46 -06:00
parent eaffd06133
commit 80ed33113c
7 changed files with 38 additions and 39 deletions

View File

@@ -8,6 +8,11 @@ class BodyCell{
this.org = org;
this.loc_col = loc_col;
this.loc_row = loc_row;
var distance = Math.max(Math.abs(loc_row)*2 + 2, Math.abs(loc_col)*2 + 2);
if (this.org.birth_distance < distance) {
this.org.birth_distance = distance;
}
}
initInherit(parent) {

View File

@@ -23,7 +23,7 @@ class KillerCell extends BodyCell{
return;
var is_hit = n_cell.state == CellStates.killer; // has to be calculated before death
n_cell.owner.harm();
if (is_hit) {
if (Hyperparams.instaKill && is_hit) {
this.org.harm();
}
}