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
User prompt
Fix Bug: 'TypeError: Box.expend is not a function' in this line: 'var InvisBox = Box.expend(function (x, y, args) {' Line Number: 556
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
in the box update method, before checking the alive state, set self.alive to false if the box's y value goes above: `STAGE_HEIGHT + BOX_HEIGHT / 2`
Code edit (3 edits merged)
Please save this source code
User prompt
add an isPaused = false variable to the interface class, which when true prevents non-interface update ticks
User prompt
Add a global TERMINAL_VELOCITY = 20 and make sure boxes and the player never exceeds this value while falling
User prompt
Replace both PLAYER_GRAVITY and BOX_GRAVITY with a single GRAVITY global of 0.5. Make sure to update old references in the box and player class
Code edit (7 edits merged)
Please save this source code
User prompt
remove all console.log commands in the tnt explode function
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
set the player hitbox alpha to 0
Code edit (1 edits merged)
Please save this source code
User prompt
when the player rotates, rotate the player graphics instead
User prompt
when checking box collision, use the player hitbox instead of the player itself
Code edit (13 edits merged)
Please save this source code
User prompt
add a hitbox to the player
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -57,9 +57,8 @@
});
var Interface = Container.expand(function () {
var self = Container.call(this);
var score = 0;
- self.isPaused = false;
var scoreTxt = self.addChild(new BorderedText(score.toString(), {
size: 150,
anchor: {
x: .5
@@ -77,8 +76,9 @@
x: .5
}
}));
;
+ self.isPaused = false;
self.isGameOver = false;
self.increment = increment;
self.gameOver = gameOver;
self.hideInstructions = hideInstructions;
@@ -584,51 +584,50 @@
}
}
});
LK.on('tick', function () {
- if (interface.isPaused) return;
if (interface.isGameOver) {
interface.gameOver();
- }
- var playerArgs = {
- interface,
- columnList
- };
- player.update(playerArgs);
- ;
- var columnArgs = {
- game: self,
- boxList
- };
- for (var i = 0; i < columnList.length; i++) {
- columnList[i].update(columnArgs);
- }
- ;
- var boxArgs = {
- game: self,
- columnList,
- effectList,
- interface,
- player
- };
- for (var i = 0; i < boxList.length; i++) {
- var box = boxList[i];
- if (box.update(boxArgs)) {
- box.destroy();
- boxList.splice(i, 1);
- i--;
+ } else if (!interface.isPaused) {
+ var playerArgs = {
+ interface,
+ columnList
+ };
+ player.update(playerArgs);
+ ;
+ var columnArgs = {
+ game: self,
+ boxList
+ };
+ for (var i = 0; i < columnList.length; i++) {
+ columnList[i].update(columnArgs);
}
- }
- ;
- for (var i = 0; i < effectList.length; i++) {
- var effect = effectList[i];
- if (effect.update()) {
- effect.destroy();
- effectList.splice(i, 1);
- i--;
+ ;
+ var boxArgs = {
+ game: self,
+ columnList,
+ effectList,
+ interface,
+ player
+ };
+ for (var i = 0; i < boxList.length; i++) {
+ var box = boxList[i];
+ if (box.update(boxArgs)) {
+ box.destroy();
+ boxList.splice(i, 1);
+ i--;
+ }
}
+ ;
+ for (var i = 0; i < effectList.length; i++) {
+ var effect = effectList[i];
+ if (effect.update()) {
+ effect.destroy();
+ effectList.splice(i, 1);
+ i--;
+ }
+ }
}
- ;
if (LK.ticks === INSTRUCTION_DURATION) {
interface.hideInstructions();
}
});
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.