Code edit (2 edits merged)
Please save this source code
User prompt
Move the column shadow to the box class
Code edit (2 edits merged)
Please save this source code
User prompt
column shadow is only visible if the boxes array size is greater than the count
Code edit (1 edits merged)
Please save this source code
User prompt
Columns should have a sub-container called boxContainer that holds Boxes
Code edit (7 edits merged)
Please save this source code
User prompt
Columns have a shadow asset which has its y property set to: `STAGE_HEIGHT - FLOOR_OFFSET - BOX_HEIGHT * self.count` in the update function
Code edit (1 edits merged)
Please save this source code
Code edit (2 edits merged)
Please save this source code
User prompt
convert interface text2 to use BorderedText instead
Code edit (3 edits merged)
Please save this source code
User prompt
add a background class
User prompt
Add a fullscreen background before the floor
Code edit (4 edits merged)
Please save this source code
User prompt
Display the following text under the score "Swipe left or right to move" and "Swipe up or tap to jump" under that
User prompt
set initial invulnerability to 0
User prompt
player no longer starts invulnerable
Code edit (1 edits merged)
Please save this source code
User prompt
player starts with invulnerability equal to INVULNERABILITY_TIME
Code edit (1 edits merged)
Please save this source code
User prompt
flash the player black when invulnerability reaches 60 and 30
User prompt
tint the player gold while it is invulnerable
Code edit (1 edits merged)
Please save this source code
User prompt
decrement player invulnerability in it's update function if it's greater than 0
===================================================================
--- original.js
+++ change.js
@@ -205,22 +205,20 @@
var self = Container.call(this);
parent.addChild(self);
self.x = x;
self.y = y;
- self.shadow = self.createAsset('shadow', 'Shadow image', 0.5, 0.5);
- self.shadow.width = BOX_WIDTH;
- self.shadow.height = BOX_HEIGHT;
- self.shadow.alpha = 0.5;
- self.addChild(self.shadow);
;
var boxes = [];
var countdown = SPAWN_INITIAL + getCountdown();
+ var shadow = self.createAsset('shadow', 'Shadow image', 0.5, 0.5);
+ shadow.alpha = 0.5;
;
self.count = 0;
self.boxes = boxes;
self.squash = squash;
self.remove = remove;
self.update = update;
+ self.addChild(shadow);
;
function getCountdown() {
return SPAWN_CONST + Math.floor(Math.random() * (SPAWN_VARIANCE + SPAWN_COUNT_VARIANCE * boxes.length));
}
@@ -245,8 +243,9 @@
}
}
}
function update(args) {
+ shadow.y = STAGE_HEIGHT - FLOOR_OFFSET - BOX_HEIGHT * self.count;
if (--countdown <= 0) {
countdown = getCountdown();
if (self.count < COLUMN_VOLUME) {
var {boxList} = args;
@@ -254,11 +253,8 @@
boxList.push(box);
boxes.push(box);
}
}
- if (self.shadow) {
- self.shadow.y = STAGE_HEIGHT - FLOOR_OFFSET - BOX_HEIGHT * self.count;
- }
}
});
var Player = Container.expand(function (parent, x, y) {
var self = Container.call(this);
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.