Added some birth distance stuff

This commit is contained in:
MaxRobinsonTheGreat
2020-08-04 15:10:13 -06:00
parent ef1d78d755
commit f3fc6813a0
4 changed files with 8 additions and 1 deletions

2
dist/js/bundle.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -32,6 +32,10 @@ class EditorController extends CanvasController{
this.env.removeCellFromOrg(this.mouse_c, this.mouse_r);
}
updateDetails() {
$('#birth-distance').val(this.env.organism.birth_distance);
}
defineCellTypeSelection() {
var self = this;
$('.cell-type').click( function() {

View File

@@ -66,6 +66,7 @@ class OrganismEditor extends Environment{
var center = this.grid_map.getCenter();
this.organism = new Organism(center[0], center[1], this, orig_org);
this.organism.updateGrid();
this.controller.updateDetails();
}
getCopyOfOrg() {

View File

@@ -189,6 +189,8 @@ class Organism {
}
if (Math.random() * 100 <= 10) {
this.birth_distance += Math.floor(Math.random() * 4) - 2;
if (this.birth_distance < 1)
this.birth_distance = 1;
}
return mutated;
}