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
@@ -382,9 +382,10 @@
effectList.push(game.addChild(new ExplosionEffect(column.x, self.y)));
self.alive = false;
var min = self.y - BOX_HEIGHT * 1.25;
var max = self.y + BOX_HEIGHT * 1.25;
- if (!player.invulnerability && player.y > min && player.y < max && player.x > column.x - BOX_WIDTH * 1.5 && player.x < column.x + BOX_WIDTH * 1.5) {
+ var playerColumn = player.parent.index;
+ if (!player.invulnerability && player.y > min && player.y < max && playerColumn >= column.index - 1 && playerColumn <= column.index + 1) {
interface.isGameOver = true;
interface.deathReason = self.deathReason;
}
for (var i = column.index - 1; i <= column.index + 1; i++) {
@@ -548,9 +549,9 @@
}
if (targetDirection) {
var moveSpeed = Math.min((targetX - self.x) * targetDirection, PLAYER_MOVE_SPEED);
self.x += moveSpeed * targetDirection;
- playerGraphics.rotation = Math.PI * (column.index + self.x / BOX_WIDTH);
+ playerGraphics.rotation = Math.PI * (column.index + self.x / BOX_WIDTH) * 0.5;
if (moveSpeed < PLAYER_MOVE_SPEED) {
targetDirection = 0;
}
}
@@ -581,11 +582,11 @@
var moveDist = BOX_WIDTH * targetDirection;
if (sideBox && !sideBox.falling) {
sideBox.touch(self);
self.x -= overhang * 2 * targetDirection;
- targetX += moveDist;
+ targetX -= moveDist;
targetDirection = -targetDirection;
- playerGraphics.rotation = Math.PI * (column.index + self.x / BOX_WIDTH);
+ playerGraphics.rotation = Math.PI * (column.index + self.x / BOX_WIDTH) * 0.5;
} else {
column = newColumn;
column.enter(self);
targetX -= moveDist;
@@ -595,11 +596,20 @@
self.airborne = true;
}
}
}
- ;
- ;
- ;
+ if (!self.airborne) {
+ var prevHeightIndex = Math.round(self.heightClimbed / BOX_HEIGHT);
+ column.touch(self, rowIndex - 1);
+ if (rowIndex > prevHeightIndex) {
+ interface.increment((rowIndex - prevHeightIndex) * POINTS_GAIN_CLIMBING);
+ self.heightClimbed = rowIndex * BOX_HEIGHT;
+ if (rowIndex >= SHIFT_THRESHOLD) {
+ return true;
+ }
+ }
+ }
+ return false;
}
function shift(amount) {
baseShift(amount);
;
@@ -642,9 +652,9 @@
var SHIFT_COUNT = 3;
var SHIFT_DURATION = STAGE_TICKS / 3;
var SHIFT_AMOUNT = SHIFT_COUNT * BOX_HEIGHT / SHIFT_DURATION;
var INSTRUCTION_DURATION = 5 * STAGE_TICKS;
-var DEATH_FALLDOWN = 'Fell into the factory!';
+var DEATH_FALLDOWN = 'Fell into the deep factory!';
var DEATH_CRUSH_BOX = 'Crushed by a packing crate!';
var DEATH_CRUSH_TNT = 'Crushed by a freshly armed TNT!';
var DEATH_CRUSH_STONE = 'Crushed by the naughty list!';
var DEATH_TNT_BASIC = 'Blew up after arming a TNT!';
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.