===================================================================
--- original.js
+++ change.js
@@ -1107,18 +1107,19 @@
var angle = Math.random() * Math.PI + Math.PI / 2;
square.rotation = angle;
trailSquares.push(square);
}
+ self.speed = 8;
// Update function to animate the trail squares
self.update = function () {
if (LK.ticks % 2 == 0) {
createTrailSquare();
}
for (var i = trailSquares.length - 1; i >= 0; i--) {
var square = trailSquares[i];
square.alpha -= 0.003;
- square.x += Math.cos(square.rotation + Math.PI / 2) * 5;
- square.y += Math.sin(square.rotation + Math.PI / 2) * 5;
+ square.x += Math.cos(square.rotation + Math.PI / 2) * self.speed;
+ square.y += Math.sin(square.rotation + Math.PI / 2) * self.speed;
if (square.alpha <= 0) {
square.destroy();
trailSquares.splice(i, 1);
}
@@ -1156,8 +1157,12 @@
if (star.alpha <= 0.1 || star.alpha >= 1) {
star.direction *= -1; // Reverse direction if alpha goes out of bounds
}
}
+ if (help1 && help1 && help1.visible) {
+ help1.alpha = 0.7 + 0.3 * Math.sin(LK.ticks / 30 + Math.PI / 2);
+ help2.alpha = 0.7 + 0.3 * Math.sin(LK.ticks / 30);
+ }
};
function selectRandomStars() {
starsToAnimate = [];
for (var i = 0; i < 20; i++) {
@@ -1179,16 +1184,23 @@
var recycle = self.attachAsset('startRecycle', {
anchorX: 0.5,
anchorY: 0.5
});
+ var startButtonText = self.attachAsset('startText', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ rotation: -0.03,
+ x: 7,
+ y: 570
+ });
+ //startButtonText.x = GAME_WIDTH / 2;
+ //startButtonText.y = road.y + 580;
// Add update function to animate recycle rotation
self.update = function () {
recycle.rotation += 0.005; // Adjust rotation speed as needed
button.rotation -= 0.005; // Adjust rotation speed as needed
//introPoster.alpha = 0.8 + 0.2 * Math.sin(LK.ticks / 100); // Animate alpha from 0.5 to 1 and vice versa
introPosterTrail.alpha = 0.8 + 0.2 * Math.sin(LK.ticks / 100);
- help1.alpha = 0.7 + 0.3 * Math.sin(LK.ticks / 30 + Math.PI / 2);
- help2.alpha = 0.7 + 0.3 * Math.sin(LK.ticks / 30);
//recycle.alpha = 0.5 + 0.5 * Math.sin(LK.ticks / 30); // Animate alpha from 1 to 0 and vice versa
};
// Event handler for button press
self.down = function (x, y, obj) {
@@ -1218,9 +1230,9 @@
help2.visible = true;
LK.setTimeout(function () {
help1.destroy();
help2.destroy();
- }, 3000);
+ }, 5000);
self.destroy(); // Remove the start button after it's pressed
};
return self;
});
@@ -1234,13 +1246,13 @@
/****
* Game Code
****/
-// Always call move and tick methods from the main tick method in the 'Game' class.
/*if (isBonusStartAnim && bonus.update) {
bonus.update();
}
*/
+// Always call move and tick methods from the main tick method in the 'Game' class.
var isDebug = false;
var _console = console;
var isStarted = false;
var isBonusStartAnim = false;
@@ -1439,8 +1451,9 @@
;
var startButton = game.addChild(new StartButton());
startButton.x = GAME_WIDTH / 2;
startButton.y = road.y;
+;
var help1 = game.addChild(LK.getAsset('help1', {
anchorX: 0.5,
anchorY: 0.5,
x: 220,
@@ -1625,8 +1638,10 @@
ROAD_GEN_DETRITUS_FLYING_CHANCE = 0.1;
ROAD_GEN_FRAGILE_NATURE_CHANCE = 0.2; // Rivers of lava
ROAD_GEN_LAVA_SIZE = 2;
ROAD_GEN_WALL_CHANCE = 0.2;
+ ROAD_GEN_DETRITUS_ASSETS = 4;
+ ROAD_GEN_DETRITUS_FLYING_ASSETS = 4;
}
;
// Animations & handlers
function animateProperty(animationPose, blendPose, blendAlpha, key, baseValue) {
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.