Added some birth distance stuff
This commit is contained in:
2
dist/js/bundle.js
vendored
2
dist/js/bundle.js
vendored
File diff suppressed because one or more lines are too long
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user