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
@@ -290,8 +290,85 @@
}
}, 205);
}
};
+ // 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]) {
+ newHeartType = level;
+ break;
+ }
+ }
+ log("initHeart - Selected heartType: " + newHeartType);
+ // Hide frames up to current heart type
+ for (var type = 0; type < newHeartType; type++) {
+ var frames = self.heartFrames[type] || [];
+ frames.forEach(function (frame) {
+ frame.visible = false;
+ });
+ }
+ // Update heart type and graphics
+ self.heartType = newHeartType;
+ self.tapLimit = TAPS_PER_LEVEL[newHeartType];
+ self.nbTapsPerFrame = self.tapLimit / 6;
+ // Calculate progress in current level (0 to 1)
+ var startTap = self.heartType === 0 ? 0 : TAPS_PER_LEVEL[self.heartType - 1];
+ var endTap = TAPS_PER_LEVEL[self.heartType];
+ 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 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]) {
+ log("ERROR: No heartFrames found for type " + self.heartType);
+ return;
+ }
+ log("initHeart - Number of frames for type " + self.heartType + ": " + self.heartFrames[self.heartType].length);
+ // Set up current and next frames
+ self.currentGraphic = self.heartFrames[self.heartType][currentFrame];
+ self.nextGraphic = self.heartFrames[self.heartType][nextFrame];
+ 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;
+ 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;
+ //self.nextGraphic.alpha = alpha;
+ log("initHeart - Set next graphic alpha: " + alpha);
+ } else {
+ log("ERROR: nextGraphic is null");
+ return;
+ }
+ log("initHeart - Starting tweens");
+ tween(self.currentGraphic, {
+ scaleX: 1.1,
+ scaleY: 1.1
+ }, {
+ duration: 300,
+ easing: tween.easeOut
+ });
+ tween(self.nextGraphic, {
+ scaleX: 1.1,
+ scaleY: 1.1
+ }, {
+ duration: 300,
+ easing: tween.easeOut
+ });
+ log("initHeart - Completed");
+ };
});
// Create a class for bigHeart
var GeneratorButton = Container.expand(function (index) {
var self = Container.call(this);
@@ -304,9 +381,10 @@
self.index = Math.min(Math.max(0, index), maxGenerators);
self.isAnimating = false; // Add isAnimating flag at instance level
var generatorAsset = self.attachAsset('generator_' + self.index, {
anchorX: 0.5,
- anchorY: 0.5
+ anchorY: 0.5,
+ y: -10
});
if (typeof GENERATORS !== 'undefined') {
self.config = Object.values(GENERATORS).find(function (g) {
return g.id === self.index;
@@ -331,9 +409,9 @@
});
self.countText.x = -buttonGraphics.width / 2 + 10;
self.countText.y = -buttonGraphics.height / 2 + 10;
self.addChild(self.countText);
- self.costText.x = 45;
+ self.costText.x = 35;
self.costText.y = 75;
self.visible = false;
self.addChild(self.costText);
if (typeof GENERATORS !== 'undefined') {
@@ -995,9 +1073,9 @@
});
}
performShake();
}
-var isDebug = false;
+var isDebug = true;
var SWIPE_THRESHOLD = 10; // Threshold in pixels to distinguish between taps and swipes
var TAP_DETECT_DELAY = 600;
var TAPS_PER_LEVEL = {
0: 99,
@@ -1010,9 +1088,9 @@
7: 999999999,
8: 9999999999,
9: 99999999999
};
-if (isDebug) {
+if (false && isDebug) {
TAPS_PER_LEVEL = {
0: 12,
1: 50,
2: 100,
@@ -1051,72 +1129,72 @@
name: "Chain Bracelet",
description: "A beautiful chain bracelet that generates love even faster",
autoClick: true,
clickRate: 3,
- cost: 150,
+ cost: 200,
upgradeLevel: 0
},
PERFUME: {
id: 3,
name: "Perfume",
description: "A delightful fragrance that enchants love",
autoClick: true,
clickRate: 5,
- cost: 300,
+ cost: 500,
upgradeLevel: 0
},
WATCH: {
id: 4,
name: "Watch",
description: "A timeless piece that speeds up love generation",
autoClick: true,
clickRate: 8,
- cost: 600,
+ cost: 1000,
upgradeLevel: 0
},
JEWELRY_SET: {
id: 5,
name: "Jewelry Set",
description: "A luxurious set that dazzles with love",
autoClick: true,
clickRate: 12,
- cost: 1200,
+ cost: 10000,
upgradeLevel: 0
},
SPORTS_CAR: {
id: 6,
name: "Sports Car",
description: "A fast car that accelerates love generation",
autoClick: true,
clickRate: 20,
- cost: 2400,
+ cost: 100000,
upgradeLevel: 0
},
VILLA: {
id: 7,
name: "Villa",
description: "A grand villa that generates love in abundance",
autoClick: true,
clickRate: 35,
- cost: 4800,
+ cost: 1000000,
upgradeLevel: 0
},
PRIVATE_JET: {
id: 8,
name: "Private Jet",
description: "A jet that takes love to new heights",
autoClick: true,
clickRate: 60,
- cost: 9600,
+ cost: 1000000000,
upgradeLevel: 0
},
INFINITE_LOVE: {
id: 9,
name: "Infinite Love",
description: "An endless source of love",
autoClick: true,
clickRate: 100,
- cost: 19200,
+ cost: 1000000000000,
upgradeLevel: 0
}
};
if (isDebug) {
@@ -1348,8 +1426,9 @@
var previousFrames = bigHeart.heartFrames[previousLevel] || [];
previousFrames.forEach(function (frame) {
if (frame && frame._activeTween) {
frame._activeTween.stop();
+ frame._activeTween = null;
}
frame.visible = false;
});
background.changeBackground(progressManager.currentLevel + 1); // Change background when level changes
@@ -1540,9 +1619,9 @@
}
};
}
function initializeGame() {
- tapCount = 0;
+ tapCount = 900;
backgroundContainer = new Container();
middlegroundContainer = new Container();
middlegroundContainer.x = 0;
middlegroundContainer.y = 0;
@@ -1564,30 +1643,18 @@
}
background.changeBackground(progressManager.currentLevel);
// Add a big heart at the center of the screen
bigHeart = new BigHeart();
+ bigHeart.initHeart();
middlegroundContainer.addChild(bigHeart);
- bigHeart.heartType = progressManager.currentLevel;
+ //bigHeart.heartType = progressManager.currentLevel;
////////////////////////////////////////////////////////////////////////////////
- bigHeart.currentGraphic = bigHeart.heartFrames[bigHeart.heartType][5];
+ /*bigHeart.currentGraphic = bigHeart.heartFrames[bigHeart.heartType][5];
bigHeart.nextGraphic = bigHeart.heartFrames[bigHeart.heartType][4];
bigHeart.currentGraphic.visible = true;
bigHeart.nextGraphic.visible = true;
+ */
projectionsManager.updateHeartType(bigHeart.heartType);
- tween(bigHeart.currentGraphic, {
- scaleX: 1.1,
- scaleY: 1.1
- }, {
- duration: 300,
- easing: tween.easeOut
- });
- tween(bigHeart.nextGraphic, {
- scaleX: 1.1,
- scaleY: 1.1
- }, {
- duration: 300,
- easing: tween.easeOut
- });
////////////////////////////////////////////////////////////////////////////////
// Add a RightBoard instance to the foreground container
rightBoard = new RightBoard();
foregroundContainer.addChild(rightBoard);
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