Code edit (3 edits merged)
Please save this source code
User prompt
Fix Bug: 'ReferenceError: COLUMN_WIDTH is not defined' in this line: 'columns.push(new Column(self, i * COLUMN_WIDTH, 0));' Line Number: 121
User prompt
Replace any and all occurances of `COLUMN_WIDTH` with `BOX_SIZE`
Code edit (1 edits merged)
Please save this source code
Code edit (9 edits merged)
Please save this source code
User prompt
columns have a `count` variable which increases by one every time a box is spawned. Additionally, created boxes take in a 4th parameter which is a `targetHeight` calculated as the STAGE_HEIGHT - count * COLUMN_WIDTH, which prevents it falling further
Code edit (2 edits merged)
Please save this source code
User prompt
instead of using tick offset for box spawning, columns should have a countdown variable that is randomly set after creation and after spawning a box
User prompt
The columns should be updated in the tick callback, not on creation silly
User prompt
columns should handle the spawning of boxes in an update function instead
User prompt
Fix Bug: 'ReferenceError: floor is not defined' in this line: 'if (self.y > floor.y - self.height) {' Line Number: 57
User prompt
Fix Bug: 'TypeError: LK.tween is not a function' in this line: 'LK.tween(player, {' Line Number: 94
User prompt
it should take the player 0.2s to move from it's old position, and should also rotate 90 degrees during the move
User prompt
boxes should get increasingly faster as if affected by gravity
User prompt
boxes have a 1% chance of being a tnt instead
Code edit (1 edits merged)
Please save this source code
User prompt
Fix Bug: 'ReferenceError: COLUMN_WIDTH is not defined' in this line: 'player.x = Math.floor(2048 / 2 / COLUMN_WIDTH) * COLUMN_WIDTH + COLUMN_WIDTH / 2;' Line Number: 97
User prompt
Create a columns array that holds a Column class instances.
User prompt
if quickly tapping on the screen, make the player jump
User prompt
the player can move a maximum of 1 column when swiping
User prompt
add a hitbox asset to the box class that, the player should check the hitbox instead of the box for intersections
User prompt
Add a floor image that is the full width of the game
User prompt
if the player collides with a box it's game over
User prompt
Fix Bug: 'TypeError: event.data is undefined' in this line: 'var currentTouchX = event.data.global.x;' Line Number: 27
User prompt
Fix Bug: 'TypeError: event.data is undefined' in this line: 'lastTouchX = event.data.global.x;' Line Number: 22
===================================================================
--- original.js
+++ change.js
@@ -99,9 +99,8 @@
});
var STAGE_WIDTH = 2048;
var STAGE_HEIGHT = 2732;
var NUM_COLUMNS = 15;
-var COLUMN_WIDTH = STAGE_WIDTH / NUM_COLUMNS;
var BOX_SIZE = STAGE_WIDTH / NUM_COLUMNS;
var PLAYER_SIZE = 0.8 * BOX_SIZE;
var SPAWN_OFFSET = -100;
var SPAWN_CONST = 30;
@@ -118,9 +117,9 @@
var columns = [];
var floor = self.addChild(new Floor(self, STAGE_WIDTH / 2, STAGE_HEIGHT));
var player = self.addChild(new Player(self, STAGE_WIDTH / 2, STAGE_HEIGHT - FLOOR_OFFSET - PLAYER_SIZE / 2));
for (var i = 0; i < NUM_COLUMNS; i++) {
- columns.push(new Column(self, i * COLUMN_WIDTH, 0));
+ columns.push(new Column(self, i * BOX_SIZE, 0));
}
var scoreTxt = new Text2('0', {
size: 150,
fill: "#ffffff"
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.