Code edit (1 edits merged)
Please save this source code
User prompt
in Starfield add a property 'direction' to star, then use it to make star alpha change from 0 to 1 and vice versa
User prompt
update this : self.update = function () { for (var i = 0; i < self.children.length; i++) { var star = self.children[i]; if (Math.random() < 0.01) { // 1% chance to animate each star per frame star.alpha = 0.5 + 0.5 * Math.sin(LK.ticks / 30 + i); // Animate alpha from 0.5 to 1.0 } } }; to use this algotithm: Every 3 sec, select 10 stars randomly, then for this selected stars animate alpha from 0 to 1 and vice versa
Code edit (10 edits merged)
Please save this source code
User prompt
in starfield, animate alpha of random stars
User prompt
animate star field by animating alpha of random stars
Code edit (1 edits merged)
Please save this source code
Code edit (5 edits merged)
Please save this source code
User prompt
add a new global function isActive() that returns isStarted && !isBonusStartAnim && !player.isDead
Code edit (2 edits merged)
Please save this source code
User prompt
Make detritus rotate on themselves when taken
Code edit (1 edits merged)
Please save this source code
User prompt
destroy binFadeInInterval after finished
Code edit (4 edits merged)
Please save this source code
User prompt
in addition to recycleBin.visible = true; recycleBinBack.visible = true; animate recycleBin and recycleBinBack alpha from 0 to 1 (don't use LK.effects.fadeObject that is not allowed)
User prompt
in addition to recycleBin.visible = true; recycleBinBack.visible = true; animate recycleBin and recycleBinBack alpha from 0 to 1
Code edit (2 edits merged)
Please save this source code
User prompt
when start button is pressed, set alpha of segments from 0 to 2 and the last 2 segments to 0. don't change any other logic
Code edit (2 edits merged)
Please save this source code
User prompt
when start button is pressed, fade out road segments from 0 to 2 and the last 2 segments. don't change any other logic
User prompt
when start button is pressed, fade out road segments from 0 to 5
Code edit (1 edits merged)
Please save this source code
Code edit (3 edits merged)
Please save this source code
User prompt
when attaching a taken detritus to game with game.addChild(self);, add it so it comes behind recycleBin in term of z-index
Code edit (4 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -207,9 +207,9 @@
anchorY: 0.1,
scaleX: Math.random() < 0.5 ? -scale : scale,
scaleY: scale,
rotation: -Math.PI * 0.25 + Math.random() * Math.PI * 0.5,
- levitOffset: 125
+ levitOffset: 170
});
} else if (Math.random() < ROAD_GEN_DETRITUS_FLYING_CHANCE) {
var detritusFlying = new DetritusFlying();
var scale = 1; //0.9 + 0.2 * Math.random();
@@ -873,9 +873,9 @@
var velocityY = dy / distance * speed;
if (distance > speed) {
if (Math.abs(self.x - startX) < Math.abs(dx / 2)) {
self.x += velocityX;
- self.y -= velocityY * 0.5 - accelerationY * 0.2; // Move up
+ self.y -= velocityY * 0.1 - accelerationY * 0.2; // Move up
} else {
self.x += velocityX;
self.y += velocityY + accelerationY; // Move down with acceleration
}
@@ -909,9 +909,9 @@
var detritusIndex = Math.floor(Math.random() * ROAD_GEN_DETRITUS_ASSETS);
var scale = 0.9 + 0.2 * Math.random();
self.attachAsset('detritus' + detritusIndex, {
anchorX: 0.5,
- anchorY: 1,
+ anchorY: 0.5,
scaleX: Math.random() < 0.5 ? -scale : scale,
scaleY: scale
});
self.taken = false;
@@ -1096,9 +1096,14 @@
/****
* Game Code
****/
+function isActive() {
+ return isStarted && !isBonusStartAnim && !player.isDead;
+}
var isStarted = false;
+var isBonusStartAnim = false;
+var isBonusActive = false;
//==============================================================================
;
// Math Constants / Pre-calculations
var MATH_4_PI = Math.PI * 4;
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.