Code edit (2 edits merged)
Please save this source code
User prompt
in StartButton, also animate recycle alpha from 1 to 0 and vice versa
Code edit (4 edits merged)
Please save this source code
User prompt
in StartButton, animate recycle rotation
Code edit (3 edits merged)
Please save this source code
User prompt
add a start button class using the current 3 startXXX assets and instanciate it after the recycle bin.
User prompt
add a global isStarted = false; then don't update Road and Player if isStarting is false;
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
in adjustScore replace scoreText.setText(String(score).padStart(6, '0')); by a the kgCollected with 2 digits
Code edit (4 edits merged)
Please save this source code
User prompt
when collecting a detritus add 0.01 to kgCollected
Code edit (9 edits merged)
Please save this source code
User prompt
extract this code : self.body.torso.tint = 0xff0000; // Tint the player's torso red self.body.legUpperLeft.children[0].tint = 0xff0000; // Tint the player's upper left leg red self.body.legUpperRight.children[0].tint = 0xff0000; // Tint the player's upper right leg red self.body.armUpperLeft.children[0].tint = 0xff0000; // Tint the player's upper left arm red self.body.armUpperRight.children[0].tint = 0xff0000; // Tint the player's upper right arm red self.body.armLowerLeft.tint = 0xff0000; self.body.armLowerRight.tint = 0xff0000; self.body.legLowerLeft.tint = 0xff0000; self.body.legLowerRight.tint = 0xff0000; self.body.pelvis.tint = 0xff0000; // Tint the player's pelvis red self.body.head.tint = 0xff0000; // Tint the player's head red self.body.footRight.tint = 0xff0000; self.body.footLeft.tint = 0xff0000; to a global function. user player global variable and make the color a parameter
Code edit (1 edits merged)
Please save this source code
User prompt
like for torso : self.body.torso.tint = 0xff0000; // Tint the player red Tint every other part in red when player fall in reiver
User prompt
in playerbody, like for torso, add a public property for each asset but dont replace existing local variables, just add new properties: example : var pelvis = ...; // Don't touch that self.pelvis = pelvis; // Add that
User prompt
Please fix the bug: 'ReferenceError: torso is not defined' in or related to this line: 'self.pelvis = self.attachAsset('pelvis', {' Line Number: 540
User prompt
in playerbody, like for torso, add a public property for each asset
Code edit (21 edits merged)
Please save this source code
User prompt
when player hits river, tint the player all in red
User prompt
when player hits river, tint it all in red
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (3 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -335,8 +335,11 @@
self.fadeout = false;
rescale();
}
function update() {
+ if (!isStarted) {
+ return;
+ }
if (self.fadeout && self.alpha > 0) {
if ((self.alpha -= ROAD_SEGMENT_FADEOUT) < 0) {
self.alpha = 0;
}
@@ -662,8 +665,11 @@
self.slideStart = slideStart;
self.slideEnd = slideEnd;
;
function update() {
+ if (!isStarted) {
+ return;
+ }
if (self.isDead) {
return;
}
var nextNode = road.getNode(1);
@@ -912,9 +918,9 @@
self.destroy();
}
} else if (!self.taken && player.body.torso.intersects(self)) {
self.taken = true;
- kgCollected += 0.01; // Add 0.01 to kgCollected
+ kgCollected += 0.02; // Add 0.01 to kgCollected
var globalPosition = self.parent.toGlobal(self.position);
self.parent.removeChild(self);
game.addChild(self);
self.position = game.toLocal(globalPosition);
@@ -1019,8 +1025,9 @@
/****
* Game Code
****/
+var isStarted = false;
LK.playMusic('bgMusic', {
loop: true
});
// Global Constants & Settings
@@ -1073,11 +1080,11 @@
var ROAD_GEN_TREE_CHANCE = 0; //0.1;
var ROAD_GEN_CLOUD_ASSETS = 4;
var ROAD_GEN_CLOUD_CHANCE = 0.2;
var ROAD_GEN_DETRITUS_ASSETS = 2;
-var ROAD_GEN_DETRITUS_CHANCE = 0.05;
+var ROAD_GEN_DETRITUS_CHANCE = 0.1;
var ROAD_GEN_DETRITUS_FLYING_ASSETS = 2;
-var ROAD_GEN_DETRITUS_FLYING_CHANCE = 0.05;
+var ROAD_GEN_DETRITUS_FLYING_CHANCE = 0.1;
var ROAD_GEN_FRAGILE_NATURE_ASSETS = 2;
var ROAD_GEN_FRAGILE_NATURE_CHANCE = 0.1;
var ROAD_GEN_WALL_ASSETS = 1;
var ROAD_GEN_WALL_CHANCE = 0.2;
white
circle sliced into many pieces, flat image. 2d, white background, shadowless.
pixel art of a tall, tree. game asset, 2d, white background, shadowless.
pixel art cloud. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
dark space.
flying lava bubble. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a bonus crystal ball with the recycle symbol. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
top view A green round start button empty in the center like a ring.