User prompt
cube_collapse must not occur in neighboring columns
User prompt
hitting a hero in a column where there is cube_collapse leads to an immediate collapse of this column and the two adjacent ones on the left and right
User prompt
Fix Bug: 'TypeError: poles[i].makeCubesFall is not a function' in or related to this line: 'poles[i].makeCubesFall();' Line Number: 190
User prompt
hitting a hero in a column where there is cube_collapse leads to the immediate collapse of this column and the two adjacent ones on the left and right
User prompt
Fix Bug: 'Uncaught ReferenceError: i is not defined' in or related to this line: 'var cube = (self.cubes.length + 1) % 10 === 0 && i % 2 === 0 ? new CollapsibleCube() : new Cube();' Line Number: 40
User prompt
cube_collapse should not be in neighbouring columns
User prompt
cube_collapse must not be in adjacent columns
User prompt
cube_collapse must not be in adjacent columns
User prompt
cube_collapse should not be one after the other
User prompt
cube_collapse should not be one after the other
User prompt
cube_collapse should not be one after the other
User prompt
cube_collapse should not be consecutive
User prompt
every 10th column should contain one cube_collapse instead of cube
User prompt
cube_collapse should occur more often and regularly
User prompt
cube_collapse should not be consecutive
User prompt
every 10th column should contain one cube_collapse instead of cube
User prompt
every 10th column on average should contain cube_collapse instead of cube
User prompt
cube_collapse should not be consecutive, but should occur regularly
User prompt
cube_collapse should not be consecutive, but should occur regularly
User prompt
cube_collapse should not be consecutive, but should occur regularly
User prompt
Instead of cube, place cube_collapse randomly at the top of some columns
User prompt
Fix Bug: 'TypeError: poles[i].cubes[j].update is not a function' in or related to this line: 'poles[i].cubes[j].update();' Line Number: 179
User prompt
Fix Bug: 'TypeError: poles[i].cubes[j].update is not a function' in or related to this line: 'poles[i].cubes[j].update();' Line Number: 179
User prompt
Fix Bug: 'TypeError: poles[i].cubes[j].update is not a function' in or related to this line: 'poles[i].cubes[j].update();' Line Number: 179
User prompt
Fix Bug: 'TypeError: poles[i].cubes[j].update is not a function' in or related to this line: 'poles[i].cubes[j].update();' Line Number: 180
===================================================================
--- original.js
+++ change.js
@@ -41,31 +41,19 @@
cube.y = -(self.cubes.length * 100) - (self.cubes.length - 1) * 2;
self.addChild(cube);
self.cubes.push(cube);
};
- self.collapsePoleAndAdjacent = function (polesArray) {
- var currentIndex = polesArray.indexOf(self);
- var indicesToCollapse = [currentIndex - 1, currentIndex, currentIndex + 1];
- indicesToCollapse.forEach(function (index) {
- if (index >= 0 && index < polesArray.length) {
- var pole = polesArray[index];
- for (var i = pole.cubes.length - 1; i >= 0; i--) {
- (function (cubeIndex) {
- LK.setTimeout(function () {
- pole.cubes[cubeIndex].isFalling = true;
- }, cubeIndex * 250);
- })(i);
- }
+ self.collapse = function (poles) {
+ self.makeCubesFall();
+ var currentIndex = poles.indexOf(self);
+ var adjacentIndices = [currentIndex - 1, currentIndex + 1];
+ adjacentIndices.forEach(function (index) {
+ if (index >= 0 && index < poles.length) {
+ poles[index].makeCubesFall();
}
});
};
self.isSliding = false;
- self.hasMadeCubesFall = false;
- self.makeCubesFall = function () {
- for (var i = 0; i < self.cubes.length; i++) {
- self.cubes[i].isFalling = true;
- }
- };
self.slideDownUp = function () {
if (!self.isSliding) {
self.isSliding = true;
var initialY = self.y;
@@ -157,17 +145,16 @@
// Collision detection with poles
for (var i = 0; i < poles.length; i++) {
var pole = poles[i];
if (hero.intersects(pole) && hero.velocityY > 0 && hero.y + hero.height / 2 < pole.y) {
- var hitCollapsibleCube = pole.cubes.some(function (cube) {
+ hero.y = pole.y - pole.getHeight() - hero.height / 2;
+ hero.isOnGround = true;
+ hero.velocityY = 0;
+ if (pole.cubes.some(function (cube) {
return cube instanceof CollapsibleCube;
- });
- if (hitCollapsibleCube) {
- pole.collapsePoleAndAdjacent(poles);
+ })) {
+ pole.collapse(poles);
} else {
- hero.y = pole.y - pole.getHeight() - hero.height / 2;
- hero.isOnGround = true;
- hero.velocityY = 0;
pole.slideDownUp();
}
}
}
girl sitting on Wrecking Ball, cartoon style.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
construction cranes on the sides of the frame, depth of field blur, cartoon style, black and white. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
"ALARM" text bubble, comic style. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
the surface is gray, concrete with a black square in the center. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Wrecking Ball with eyes, cartoon style.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
the surface is red, concrete with a black square in the center.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
"ALARM" text bubble yellow, comic book style.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
the surface is yellow, concrete with a black square in the center. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.