Commit 68130a16 authored by Matthew Odle's avatar Matthew Odle

move some centipede params to knobsAndLevers

parent 149ce4fa
......@@ -48,18 +48,9 @@ var centipedes = {
knobsAndLevers.centipede.args.x = this.positions[this.centipedes.length % this.positions.length];
},
make : function() {
centipede = new Component(knobsAndLevers.centipede.args);
centipede.directionX = 1;
centipede.directionY = 1;
centipede.distanceMovedX = 0;
centipede.distanceMovedY = 0;
centipede.distanceMovedFromBottom = 0;
centipede.reverseDirectionX = false;
centipede.reverseDirectionY = false;
centipede.moveVertically = true;
let centipede = Object.assign(new Component(knobsAndLevers.centipede.args), knobsAndLevers.centipede.defaults);
let pointValue = knobsAndLevers.centipede.pointValue;
centipede.pointValue = supporting.getRandom(pointValue, pointValue + 20);
centipede.updated = false;
return centipede;
},
cannotAdd : function(centipede) {
......
......@@ -67,6 +67,17 @@ var knobsAndLevers = {
return direction;
},
},
defaults : {
directionX : 1,
directionY : 1,
distanceMovedX : 0,
distanceMovedY : 0,
distanceMovedFromBottom : 0,
reverseDirectionX : false,
reverseDirectionY : false,
moveVertically : true,
updated : false,
},
init : function(configs) {
this.args.width = configs.general.gridSquareSideLength;
this.args.height = configs.general.gridSquareSideLength;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment