Code edit (23 edits merged)
Please save this source code
User prompt
Now add a new class DetritusFlying
Code edit (1 edits merged)
Please save this source code
Code edit (20 edits merged)
Please save this source code
User prompt
use Detritus class in road generateBackground, for that create a clone of attachAssetRadial that take an object insteade of an asset name but does the same thing
User prompt
use Detritus class in road generateBackground
User prompt
add a class for detritus
User prompt
Clone current system used to spanw Trees to spawn detritus
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
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
User prompt
log variables before the line if (!jumpAction && jumpStep >= PLAYER_JUMP_STEP_MIN || jumpStep >= PLAYER_JUMP_STEP_MAX)
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (5 edits merged)
Please save this source code
User prompt
add an asset for the background
Code edit (14 edits merged)
Please save this source code
User prompt
in Sun class, animate the alpha of each circle alternatively
User prompt
Please fix the bug: 'Uncaught ReferenceError: rotation0 is not defined' in or related to this line: 'parent.attachAsset(asset, {' Line Number: 119
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
add a starfield in the background
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -107,10 +107,10 @@
}
function attachObjectRadial(parent, object, obj) {
var offsetTotal = ROAD_SEGMENT_HEIGHT - (obj.offset || 10);
var rotation = -(1 - obj.anchorR) * ROAD_SEGMENT_ANGLE;
- object.x = Math.sin(rotation) * offsetTotal - 125;
- object.y = Math.cos(rotation) * -offsetTotal - 125;
+ object.x = Math.sin(rotation) * offsetTotal - 125 - 200 * (obj.flying || 0);
+ object.y = Math.cos(rotation) * -offsetTotal - 125 - 200 * (obj.flying || 0);
//object.width = obj.width;
//object.height = obj.height;
object.anchorX = obj.anchorX;
object.anchorY = obj.anchorY;
@@ -149,9 +149,10 @@
anchorX: 0.5,
anchorY: 0.1,
scaleX: Math.random() < 0.5 ? -scale : scale,
scaleY: scale,
- rotation: -Math.PI * 0.25 + Math.random() * Math.PI * 0.5
+ rotation: -Math.PI * 0.25 + Math.random() * Math.PI * 0.5,
+ flying: 1
});
} else {
if (Math.random() < ROAD_GEN_TREE_CHANCE) {
var treeIndex = Math.floor(Math.random() * ROAD_GEN_TREE_ASSETS);
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.