Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
Fix Bug: 'ReferenceError: enter is not defined' in this line: 'self.enter = enter;' Line Number: 434
Code edit (5 edits merged)
Please save this source code
User prompt
Fix Bug: 'ReferenceError: columnIndex is not defined' in this line: 'if (!player.invulnerability && player.y > min && player.y < max && playerColumn >= column.index - 1 && playerColumn <= columnIndex + 1) {' Line Number: 387
Code edit (9 edits merged)
Please save this source code
User prompt
Fix Bug: 'TypeError: newColumn is undefined' in this line: 'var sideBox = newColumn.boxes[rowIndex];' Line Number: 580
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -459,8 +459,9 @@
}
}
}
function update(args) {
+ var {player} = args;
if (--countdown <= 0) {
countdown = getCountdown();
if (self.count < COLUMN_VOLUME) {
var {boxList} = args;
@@ -482,15 +483,14 @@
boxList.push(box);
boxes.push(box);
}
}
+ if (player.parent === self) {
+ self.children.sort(function (a, b) {
+ return b.y - a.y;
+ });
+ }
}
- function enter(player) {
- self.addChild(player);
- self.children.sort(function (a, b) {
- return b.y - a.y;
- });
- }
});
var Player = ShiftableContainer.expand(function (x, y) {
var self = ShiftableContainer.call(this);
var baseShift = self.shift;
@@ -587,11 +587,11 @@
targetDirection = -targetDirection;
playerGraphics.rotation = Math.PI * (column.index + self.x / BOX_WIDTH) * 0.5;
} else {
column = newColumn;
- column.enter(self);
targetX -= moveDist;
self.x -= moveDist;
+ column.addChild(self);
var underBox = column.boxes[rowIndex - 1];
if (!underBox || underBox.falling) {
self.airborne = true;
}
@@ -742,9 +742,10 @@
}
;
var columnArgs = {
game: self,
- boxList
+ boxList,
+ player
};
for (var i = 0; i < columnList.length; i++) {
columnList[i].update(columnArgs);
}
Pixel art, side view of a concrete factory floor . Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Pixel art, square with cute eyes . Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Pixel art, square with the texture of a tnt . Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a crate, side view . Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a crate, flat side view . Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a crate, flat side view . Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Pixel art of a golden christmas present. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Pixel art of a green christmas present with red ribbons. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Pixel art of an elaborate green christmas present with red ribbons. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a metal background.
pixel art of a crate made of stone with a label of coal on the side, flat side view. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a square tnt explosion. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.