Range can now be changed by means such as prop.js
This commit is contained in:
parent
254dd80e30
commit
f11287ed9c
|
|
@ -1,11 +1,17 @@
|
||||||
elements.up_pusher = {
|
elements.up_pusher = {
|
||||||
|
properties: {
|
||||||
|
range: 10,
|
||||||
|
},
|
||||||
color: "#7f7f7f",
|
color: "#7f7f7f",
|
||||||
tick: function(pixel) {
|
tick: function(pixel) {
|
||||||
for(i=9; i>=0; i--) {
|
if(!pixel.range) {
|
||||||
|
pixel.range = 10;
|
||||||
|
};
|
||||||
|
for(i=(pixel.range - 1); i>=0; i--) { //9 -> 10
|
||||||
if (!isEmpty(pixel.x,pixel.y-1-i,true)) {
|
if (!isEmpty(pixel.x,pixel.y-1-i,true)) {
|
||||||
tryMove(pixelMap[pixel.x][pixel.y-1-i],pixel.x,pixel.y-2-i)
|
tryMove(pixelMap[pixel.x][pixel.y-1-i],pixel.x,pixel.y-2-i);
|
||||||
}
|
};
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
category: "machines",
|
category: "machines",
|
||||||
insulate: true,
|
insulate: true,
|
||||||
|
|
@ -14,12 +20,18 @@ elements.up_pusher = {
|
||||||
|
|
||||||
elements.down_pusher = {
|
elements.down_pusher = {
|
||||||
color: "#7f7f7f",
|
color: "#7f7f7f",
|
||||||
|
properties: {
|
||||||
|
range: 10,
|
||||||
|
},
|
||||||
tick: function(pixel) {
|
tick: function(pixel) {
|
||||||
for(i=9; i>=0; i--) {
|
if(!pixel.range) {
|
||||||
|
pixel.range = 10;
|
||||||
|
};
|
||||||
|
for(i=(pixel.range - 1); i>=0; i--) {
|
||||||
if (!isEmpty(pixel.x,pixel.y+1+i,true)) {
|
if (!isEmpty(pixel.x,pixel.y+1+i,true)) {
|
||||||
tryMove(pixelMap[pixel.x][pixel.y+1+i],pixel.x,pixel.y+2+i)
|
tryMove(pixelMap[pixel.x][pixel.y+1+i],pixel.x,pixel.y+2+i);
|
||||||
}
|
};
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
category: "machines",
|
category: "machines",
|
||||||
insulate: true,
|
insulate: true,
|
||||||
|
|
@ -28,12 +40,18 @@ elements.down_pusher = {
|
||||||
|
|
||||||
elements.left_pusher = {
|
elements.left_pusher = {
|
||||||
color: "#7f7f7f",
|
color: "#7f7f7f",
|
||||||
|
properties: {
|
||||||
|
range: 10,
|
||||||
|
},
|
||||||
tick: function(pixel) {
|
tick: function(pixel) {
|
||||||
for(i=9; i>=0; i--) {
|
if(!pixel.range) {
|
||||||
|
pixel.range = 10;
|
||||||
|
};
|
||||||
|
for(i=(pixel.range - 1); i>=0; i--) {
|
||||||
if (!isEmpty(pixel.x-1-i,pixel.y,true)) {
|
if (!isEmpty(pixel.x-1-i,pixel.y,true)) {
|
||||||
tryMove(pixelMap[pixel.x-1-i][pixel.y],pixel.x-2-i,pixel.y)
|
tryMove(pixelMap[pixel.x-1-i][pixel.y],pixel.x-2-i,pixel.y);
|
||||||
}
|
};
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
category: "machines",
|
category: "machines",
|
||||||
insulate: true,
|
insulate: true,
|
||||||
|
|
@ -42,12 +60,18 @@ elements.left_pusher = {
|
||||||
|
|
||||||
elements.right_pusher = {
|
elements.right_pusher = {
|
||||||
color: "#7f7f7f",
|
color: "#7f7f7f",
|
||||||
|
properties: {
|
||||||
|
range: 10,
|
||||||
|
},
|
||||||
tick: function(pixel) {
|
tick: function(pixel) {
|
||||||
for(i=9; i>=0; i--) {
|
if(!pixel.range) {
|
||||||
|
pixel.range = 10;
|
||||||
|
};
|
||||||
|
for(i=(pixel.range - 1); i>=0; i--) {
|
||||||
if (!isEmpty(pixel.x+1+i,pixel.y,true)) {
|
if (!isEmpty(pixel.x+1+i,pixel.y,true)) {
|
||||||
tryMove(pixelMap[pixel.x+1+i][pixel.y],pixel.x+2+i,pixel.y)
|
tryMove(pixelMap[pixel.x+1+i][pixel.y],pixel.x+2+i,pixel.y);
|
||||||
}
|
};
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
category: "machines",
|
category: "machines",
|
||||||
insulate: true,
|
insulate: true,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue