Code edit (8 edits merged)
Please save this source code
User prompt
add a new function popMessage(text)
Code edit (14 edits merged)
Please save this source code
User prompt
add a new global messageText and initialize it in initializeGame as a text2 in the bottom center of the screen
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
use formatGeneratorPrice to display generators cost
User prompt
add a new function formatGeneratorPrice to write genrator cost with abreviations : 1000 => 1K 1000000 => 1M ...
Code edit (1 edits merged)
Please save this source code
User prompt
add a bit of randomness in performShake movements (but always return to a normal position)
User prompt
shakeScreen anim doesn't look like a shake as it is only 3 slow movements. Anlayse then use a loop or a recursive approach to make 10 loops of 3 tween anims of 100ms
User prompt
make shakeScreen last 3sec
User prompt
make shakeScreen last 1sec
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
use self.tapMultiplier in manualGeneration
Code edit (2 edits merged)
Please save this source code
User prompt
when player buy generator index N; set the multiplier to 2 pow (N+1)
User prompt
in progressManager add a new property self.tapMultiplier = 1
Code edit (2 edits merged)
Please save this source code
User prompt
add a new global variable unlockedGeneratorIndex = 0; to track the index of last unlocked generator
Code edit (3 edits merged)
Please save this source code
User prompt
create a new global allowSwipe = false; when play unlocks generator index 5, set it to true; ignore swipe moves on buttons or right board when allowSwipe is false
User prompt
when there is less than 6 generator buttons visible, ignore the swipes
Code edit (2 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -294,10 +294,12 @@
// Initialize heart based on tap count
self.initHeart = function () {
var newHeartType = 0;
// Determine heart type based on tapCount
- for (var level = 9; level >= 0; level--) {
- if (tapCount >= TAPS_PER_LEVEL[level]) {
+ for (var level = 9; level > 0; level--) {
+ // 0 < 50 < 99 => 0
+ // 99 < 110 < 999 => 1
+ if (tapCount >= TAPS_PER_LEVEL[level - 1]) {
newHeartType = level;
break;
}
}
@@ -319,10 +321,10 @@
var progress = Math.min(1, (tapCount - startTap) / (endTap - startTap));
log("initHeart - Progress calculation: " + progress + " (tapCount: " + tapCount + ", startTap: " + startTap + ", endTap: " + endTap + ")");
// Map progress to frame indices (frames go from 5 to 0)
var frameProgress = Math.min(5, progress * 5);
- var currentFrame = Math.max(0, Math.min(5, 5 - Math.floor(frameProgress)));
- var nextFrame = Math.max(0, currentFrame - 1);
+ var currentFrame = Math.max(0, Math.min(5, Math.floor(frameProgress)));
+ var nextFrame = Math.max(0, currentFrame + 1);
var alpha = frameProgress - Math.floor(frameProgress);
log("initHeart - Frame indices: current=" + currentFrame + ", next=" + nextFrame + ", alpha=" + alpha);
// Check if heartFrames exists for this type
if (!self.heartFrames[self.heartType]) {
@@ -336,16 +338,22 @@
log("initHeart - Current graphic: " + (self.currentGraphic ? "exists" : "null") + ", Next graphic: " + (self.nextGraphic ? "exists" : "null"));
// Set visibility and alpha values
if (self.currentGraphic) {
self.currentGraphic.visible = true;
+ if (isDebug) {
+ self.currentGraphic.tint = 0x00FF00;
+ }
self.currentGraphic.alpha = 1 - alpha;
log("initHeart - Set current graphic alpha: " + (1 - alpha));
} else {
log("ERROR: currentGraphic is null");
return;
}
if (self.nextGraphic) {
self.nextGraphic.visible = true;
+ if (isDebug) {
+ self.nextGraphic.tint = 0xFF0000;
+ }
//self.nextGraphic.alpha = alpha;
log("initHeart - Set next graphic alpha: " + alpha);
} else {
log("ERROR: nextGraphic is null");
@@ -365,8 +373,9 @@
}, {
duration: 300,
easing: tween.easeOut
});
+ shakeMiddleground();
log("initHeart - Completed");
};
});
// Create a class for bigHeart
@@ -987,8 +996,21 @@
/****
* Game Code
****/
+// Create a text object to display messages
+messageText = new Text2('Welcome to the Game!', {
+ size: 100,
+ fill: 0xFFFFFF,
+ dropShadow: true,
+ align: 'center'
+});
+// Center the text horizontally, anchor point set at the middle of its top edge.
+messageText.anchor.set(0.5, 0);
+// Position the text at the bottom-center of the screen.
+LK.gui.bottom.addChild(messageText);
+// Start updtes
+var messageText; // Global variable for displaying messages
function formatGeneratorPrice(value) {
if (value >= 1e12) {
return (value / 1e12).toFixed(1) + 'T';
} else if (value >= 1e9) {
@@ -1669,8 +1691,9 @@
tapCountText.anchor.set(0.5, 0);
// Position the text at the top-center of the screen.
LK.gui.top.addChild(tapCountText);
// Start updtes
+ bigHeart.down();
var intervalId = LK.setInterval(function () {
progressManager.updateGame();
}, 1000);
}
a big lovely heart
a big stone heart
a big used copper heart
face view of a big bronze heart
face view of a big silver heart
Big shining gold heart verly slightly ornate. face view.
Big precious shiny porcelain heart slightly ornate. face view.
Large precious heart in mother-of-pearl, lightly ornate. Front view.
Large heart in precious ruby, very lightly decorated. Front view.
The most precious large heart in diamond, Front view.
clean pink enamel board witha very thin border