Code edit (9 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: road is undefined' in or related to this line: 'if (Math.random() < ROAD_GEN_DETRITUS_CHANCE) {' Line Number: 183
User prompt
Please fix the bug: 'TypeError: road is undefined' in or related to this line: 'if (Math.random() < ROAD_GEN_DETRITUS_CHANCE) {' Line Number: 183
Code edit (1 edits merged)
Please save this source code
User prompt
play bgMusic in loop
Code edit (9 edits merged)
Please save this source code
User prompt
play collectDetritus when taking a detritus
Code edit (1 edits merged)
Please save this source code
User prompt
add a class FragileNature like Detritus
Code edit (1 edits merged)
Please save this source code
User prompt
enhance the throw to bin anim by progressively reducing detritus size while approaching the target
Code edit (1 edits merged)
Please save this source code
User prompt
destroy taken detritus when they reach the target position
Code edit (1 edits merged)
Please save this source code
User prompt
when Detritus is taken, detach it from its parent and attach it to the game at the same position
Code edit (1 edits merged)
Please save this source code
User prompt
change the logic to make Detritus check for collision with Player and not Player check for colision with Detritus
Code edit (11 edits merged)
Please save this source code
User prompt
when taken, ignore current movement and animate the movment from thee detritus position to 150,1700 (recycle bin)
User prompt
when play intersects a Detritus, flag it as taken.
Code edit (5 edits merged)
Please save this source code
User prompt
add recyclebin to the game vertical center, on the left
Code edit (2 edits merged)
Please save this source code
User prompt
in DetritusFlying update, make rotation more chaotic
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -162,9 +162,9 @@
rotation: -Math.PI * 0.25 + Math.random() * Math.PI * 0.5,
flying: 1,
levitOffset: 525
});
- } else if (road.riverSegmentCount < ROAD_MAX_RIVER_SEGMENTS && Math.random() < ROAD_GEN_FRAGILE_NATURE_CHANCE) {
+ } else if (road && road.riverSegmentCount < ROAD_MAX_RIVER_SEGMENTS && Math.random() < ROAD_GEN_FRAGILE_NATURE_CHANCE) {
self.segmentRiver.visible = true;
road.riverSegmentCount++;
/*
var fragileNature = new FragileNature();
@@ -905,12 +905,10 @@
var score = 0;
var winningTime = 0;
var gameOver = false;
var distanceRemaining = SCORE_TOTAL_DISTANCE;
-var road;
;
// Instances
-var road;
var background = game.addChild(LK.getAsset('background', {
anchorX: 0.5,
anchorY: 0.5,
x: GAME_WIDTH / 2,
@@ -924,9 +922,9 @@
var sun = game.addChild(new Sun({
x: GAME_WIDTH / 2,
y: 50
}));
-road = game.addChild(new Road({
+var road = game.addChild(new Road({
x: GAME_WIDTH / 2,
y: GAME_HEIGHT - GAME_WIDTH / 2
}));
var player = game.addChild(new Player({
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.