User prompt
Fix Bug: 'TypeError: self.children.order is not a function' in this line: 'self.children.order(function (a, b) {' Line Number: 488
Code edit (3 edits merged)
Please save this source code
User prompt
player starts off being invulnerable for the invulnerability time
Code edit (1 edits merged)
Please save this source code
User prompt
Fix Bug: 'ReferenceError: DEATH_CRUSH_STONE is not defined' in this line: 'self.deathReason = DEATH_CRUSH_STONE;' Line Number: 286
Code edit (1 edits merged)
Please save this source code
User prompt
when the interface's gameover function is called, display the death reason as a BorderedText below the score, and additionally call the hideInstructions function
Code edit (4 edits merged)
Please save this source code
User prompt
add a deathReason variable to the interface
Code edit (1 edits merged)
Please save this source code
Code edit (13 edits merged)
Please save this source code
User prompt
prevent box shadow scale being less than the `SHADOW_MIN_SCALE` value
User prompt
add a global called `SHADOW_MIN_SCALE` of value 0.1
User prompt
Fix Bug: 'ReferenceError: count is not defined' in this line: 'if (countdown <= 0) {' Line Number: 329
Code edit (1 edits merged)
Please save this source code
User prompt
Rename `shiftContainer` function to `shift` for all classes
User prompt
Fix Bug: 'ReferenceError: shift is not defined' in this line: 'self.shift = shift;' Line Number: 95
User prompt
Rename `shiftContainer` to `shift` for all classes
User prompt
Rename `shiftContainer` to `shift` for all classes
User prompt
Remove the unused shift variable from the shiftableContainer class only
User prompt
Rename every single occurrence of `baseShiftContainer` to `baseShift`
User prompt
Fix Bug: 'ReferenceError: baseShiftContainer is not defined' in this line: 'baseShiftContainer(amount);' Line Number: 574
User prompt
Fix Bug: 'ReferenceError: baseShiftContainer is not defined' in this line: 'baseShiftContainer();' Line Number: 119
User prompt
Rename every single occurrence of `baseShiftContainer` to `baseShift`
Code edit (3 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -190,8 +190,9 @@
self.activation = activation;
self.collide = collide;
self.touch = touch;
self.shift = shift;
+ self.deathReason = DEATH_CRUSH_BOX;
;
function build(name, xAnchor, yAnchor, variations) {
var boxGraphics;
if (name) {
@@ -250,8 +251,9 @@
function collide(args) {
var {player, interface} = args;
if (!player.invulnerability) {
interface.isGameOver = true;
+ interface.deathReason = self.deathReason;
}
return false;
}
function touch(target) {}
@@ -280,8 +282,9 @@
var StoneBox = Box.expand(function (x, y, args) {
var self = Box.call(this, x, y, args);
;
self.build('stone', .5, .5);
+ self.deathReason = DEATH_CRUSH_STONE;
});
var PointsBox = Box.expand(function (x, y, args) {
var self = Box.call(this, x, y, args);
;
@@ -341,8 +344,9 @@
self.build('tnt', .5, .55);
self.activation = activation;
self.collide = collide;
self.touch = touch;
+ self.deathReason = DEATH_CRUSH_TNT;
;
function activation(args) {
if (countdown <= 0) {
explode(args);
@@ -363,12 +367,14 @@
function touch(target) {
if (target instanceof Player) {
if (!self.active) {
self.active = true;
+ self.deathReason = DEATH_TNT_BASIC;
countdown = TNT_COUNTDOWN;
}
} else if (target instanceof StoneBox) {
self.active = true;
+ self.deathReason = DEATH_TNT_INSTA;
countdown = 0;
}
}
function explode(args) {
@@ -378,8 +384,9 @@
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) {
interface.isGameOver = true;
+ interface.deathReason = self.deathReason;
}
for (var i = column.index - 1; i <= column.index + 1; i++) {
var col = columnList[i];
if (col) {
@@ -389,8 +396,9 @@
if (box.y > min) {
if (box !== self) {
if (box instanceof TntBox) {
box.active = true;
+ box.deathReason = DEATH_TNT_CHAIN;
} else if (!(box instanceof StoneBox || box instanceof InvisBox)) {
box.alive = false;
}
}
@@ -549,8 +557,9 @@
self.airborne = false;
verticalSpeed = 0;
if (self.y === BOX_LINE) {
interface.isGameOver = true;
+ interface.deathReason = DEATH_FALLDOWN;
}
}
} else {
if (self.y < targetY) {
@@ -597,13 +606,16 @@
var STAGE_TICKS = 60;
var CONTROL_SWIPE_DIST = 100;
var CONTROL_TAP_TICKS = STAGE_TICKS / 3;
var NUM_COLUMNS = 9;
+var BOX_LINE = STAGE_HEIGHT;
var BOX_WIDTH = STAGE_WIDTH / NUM_COLUMNS;
var BOX_HEIGHT = 0.75 * BOX_WIDTH;
-var BOX_LINE = STAGE_HEIGHT;
var BOX_SPEED = 5;
var BOX_GRAVITY = 0.2;
+var TNT_COUNTDOWN = 2 * STAGE_TICKS;
+var INVULNERABILITY_TIME = 5 * STAGE_TICKS;
+var COLUMN_VOLUME = Math.ceil(BOX_LINE / BOX_HEIGHT);
var PLAYER_SIZE = 0.8 * BOX_WIDTH;
var PLAYER_GRAVITY = 0.5;
var PLAYER_JUMP_SPEED = 20;
var PLAYER_MOVE_SPEED = 25;
@@ -618,16 +630,20 @@
var SPAWN_POINTS_CHANCE = 0.08;
var SPAWN_STONE_CHANCE = 0.1;
var POINTS_GAIN_CLIMBING = 1;
var POINTS_GAIN_PICKUP = 5;
-var INVULNERABILITY_TIME = 5 * STAGE_TICKS;
-var INSTRUCTION_DURATION = 5 * STAGE_TICKS;
var SHIFT_THRESHOLD = 6;
var SHIFT_COUNT = 3;
var SHIFT_DURATION = STAGE_TICKS / 3;
var SHIFT_AMOUNT = SHIFT_COUNT * BOX_HEIGHT / SHIFT_DURATION;
-var TNT_COUNTDOWN = 2 * STAGE_TICKS;
-var COLUMN_VOLUME = Math.ceil(BOX_LINE / BOX_HEIGHT);
+var INSTRUCTION_DURATION = 5 * STAGE_TICKS;
+var DEATH_FALLDOWN = 'Fell into the factory!';
+var DEATH_CRUSH_BOX = 'Crushed by a packing crate!';
+var DEATH_CRUSH_TNT = 'Crushed by an unarmed TNT!';
+var DETAH_CRUSH_STONE = 'Crushed by the naughty list!';
+var DEATH_TNT_BASIC = 'Blew up after arming a TNT!';
+var DEATH_TNT_INSTA = 'Coal detonated a TNT... And you!';
+var DEATH_TNT_CHAIN = 'Blew up in a chain reaction!';
;
var Game = Container.expand(function () {
var self = Container.call(this);
var lastTouchX = null;
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.