Code edit (8 edits merged)
Please save this source code
User prompt
about the main BigHeart : when score decrease the system with the 6 frames per heart type based on alpha is broken. This requires a deep analysis to find a way that doesn't break current gameplay
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'BigInt is not a function' in or related to this line: 'var tapCount = BigInt(MAX_DISPLAY_NUMBER) - BigInt(1);' Line Number: 1019
User prompt
Please fix the bug: 'BigInt is not a function' in or related to this line: 'var tapCount = BigInt(MAX_DISPLAY_NUMBER) - BigInt(1n);' Line Number: 1019
User prompt
Please fix the bug: 'BigInt is not a function' in or related to this line: 'var tapCount = BigInt(MAX_DISPLAY_NUMBER) - BigInt(1);' Line Number: 1019
User prompt
Please fix the bug: 'BigInt is not a function' in or related to this line: 'var tapCount = BigInt(MAX_DISPLAY_NUMBER) - BigInt(1n);' Line Number: 1019
User prompt
Please fix the bug: 'BigInt is not a function' in or related to this line: 'var tapCount = BigInt(MAX_DISPLAY_NUMBER) - BigInt(1);' Line Number: 1019
User prompt
Please fix the bug: 'Cannot mix BigInt and other types, use explicit conversions' in or related to this line: 'var tapCount = BigInt(MAX_DISPLAY_NUMBER - 1n);' Line Number: 1019
User prompt
Please fix the bug: 'BigInt is not a function' in or related to this line: 'var tapCount = BigInt(MAX_DISPLAY_NUMBER - 1);' Line Number: 1019
User prompt
use BigInt for tapCount and money
Code edit (1 edits merged)
Please save this source code
User prompt
10000000000 => 10 Q : still wrong it shoud be 10000000000 => 10 B Analyze deeply and fix
Code edit (15 edits merged)
Please save this source code
User prompt
when taps is 10000000000 formatTapCount returns 10000000 B" : it's wrong, it should be 10 B
User prompt
currently format function gives : 10000000 => 10000000.000 B it should display non significative zeros
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
when spawning a gift, set a random rotation winthin a range of -PI/4 +PI/4
Code edit (18 edits merged)
Please save this source code
User prompt
in GiftRain, when a gift moves out of bounds move it back to gift.x = Math.random() * (1948 - 100) + 100; gift.y = -300; // Start above the screen in order to make a countious anim
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
I don't see gifts falling; I thing activesGifts are not atteched to the GiftRain instance in the GiftRain class
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -215,8 +215,11 @@
// Update alpha for smooth transition
if (self.currentGraphic) {
self.currentGraphic.alpha = 1 - alpha;
}
+ if (self.nextGraphic) {
+ self.nextGraphic.alpha = alpha;
+ }
};
// Explosion Animation
self.animateExplosion = function (callback) {
if (!self.explosionTriggered) {
@@ -833,10 +836,9 @@
id: 0,
name: "Rose",
description: "A charming rose that generates a few love beats",
autoClick: true,
- clickRate: 999999999,
- //1, // TEMP DEBUG !!!
+ clickRate: 1,
// 1 click per 10 seconds
cost: 10,
upgradeLevel: 0
},
@@ -845,18 +847,18 @@
name: "Choclate",
description: "A sweet choclate that generates love faster",
autoClick: true,
clickRate: 2,
- cost: 11,
+ cost: 100,
upgradeLevel: 0
},
CHAIN_BRACELET: {
id: 2,
name: "Chain Bracelet",
description: "A beautiful chain bracelet that generates love even faster",
autoClick: true,
clickRate: 3,
- cost: 12,
+ cost: 300,
upgradeLevel: 0
}
};
var UPGRADES = {
@@ -924,16 +926,16 @@
});
}
});
}
-var isDebug = true;
+var isDebug = false;
var SWIPE_THRESHOLD = 10; // Threshold in pixels to distinguish between taps and swipes
var TAP_DETECT_DELAY = 600;
// Declare maxGenerators as a global variable
var maxGenerators = 2;
var MAX_DISPLAY_NUMBER = "9999999999999999"; //9 999 999 999 999 999
// Declare tapCount as a global variable
-var tapCount = MAX_DISPLAY_NUMBER;
+var tapCount = 0;
var nbHearts = 10;
var backgroundContainer = new Container();
var middlegroundContainer = new Container();
middlegroundContainer.x = 0;
@@ -968,31 +970,10 @@
middlegroundContainer.addChild(bigHeart);
// Add a RightBoard instance to the foreground container
var rightBoard = new RightBoard();
foregroundContainer.addChild(rightBoard);
-function formatTapCount(taps) {
- // Convert to string if it's a number
- taps = taps.toString();
- // If the number is small enough, return it with commas
- if (taps.length <= 15) {
- return parseInt(taps).toLocaleString();
- }
- var suffixes = ['', 'K', 'M', 'B', 'T', 'Q', 'QT', 'S'];
- var tier = 0;
- // Work with the string length to determine the tier
- var magnitude = Math.floor((taps.length - 1) / 3);
- tier = Math.min(magnitude - 3, suffixes.length - 1); // Start suffixes at billions
- if (tier <= 0) {
- return parseInt(taps).toLocaleString();
- }
- // Extract the significant digits for formatting
- var significantDigits = taps.slice(0, 4); // Get first 4 digits
- var decimalPlaces = 3 - taps.length % 3;
- // Format the number with up to 3 decimal places
- var formattedNumber = (parseInt(significantDigits) / Math.pow(10, decimalPlaces)).toFixed(decimalPlaces);
- // Remove trailing zeros after decimal point
- formattedNumber = formattedNumber.replace(/\.?0+$/, '');
- return formattedNumber + ' ' + suffixes[tier];
+function updateTapCountText() {
+ tapCountText.setText('LOVE\r\n' + tapCount);
}
// Helper function to add large numbers as strings
function addLargeNumbers(a, b) {
// Convert numbers to strings if they aren't already
@@ -1017,11 +998,42 @@
result = carry + result;
}
return result;
}
-// Update the tapCountText whenever tapCount changes
-function updateTapCountText() {
- tapCountText.setText('LOVE\r\n' + formatTapCount(tapCount));
+// Helper function to subtract large numbers as strings
+function subtractLargeNumbers(a, b) {
+ // Convert numbers to strings if they aren't already
+ a = a.toString();
+ b = b.toString();
+ // If b is bigger than a, result would be negative
+ if (b.length > a.length || b.length === a.length && b > a) {
+ return "0";
+ }
+ var result = '';
+ var borrow = 0;
+ // Pad b with leading zeros to match a's length
+ while (b.length < a.length) {
+ b = '0' + b;
+ }
+ // Subtract digits from right to left
+ for (var i = a.length - 1; i >= 0; i--) {
+ var digitA = parseInt(a[i]);
+ var digitB = parseInt(b[i]);
+ // Handle borrowing
+ if (borrow) {
+ digitA--;
+ borrow = 0;
+ }
+ // Need to borrow from next digit
+ if (digitA < digitB) {
+ digitA += 10;
+ borrow = 1;
+ }
+ result = digitA - digitB + result;
+ }
+ // Remove leading zeros
+ result = result.replace(/^0+/, '');
+ return result || "0";
}
// Global ProgressManager
function _typeof(o) {
"@babel/helpers - typeof";
@@ -1070,9 +1082,9 @@
function ProgressManager() {
var self = this;
self.maxHeartBeatsPerSecond = 8; // Add maxHeartBeatsPerSecond property
self.priceIncreaseRate = 1.33; // Extracted price increase rate
- self.money = tapCount; // // TEMP DEBUG !!!// TEMP DEBUG !!!
+ self.money = tapCount;
self.generators = {};
self.generatorCounts = {}; // Add a counter for each generator
self.upgrades = {};
self.currentTime = Date.now();
@@ -1117,9 +1129,12 @@
});
// Calculate beats based on generation rate
var beatsToGenerate = Math.floor(tempGenerated / 2); // One beat every 10 taps generated
beatsToGenerate = Math.min(beatsToGenerate, self.maxHeartBeatsPerSecond); // Cap at 5 beats per update to avoid overwhelming
- self.money = addLargeNumbers(self.money, tempGenerated.toString());
+ if (tempGenerated > 0) {
+ self.money = addLargeNumbers(self.money, tempGenerated.toString());
+ tapCount = self.money;
+ }
self.updateGeneratorsUi();
// Trigger multiple beats based on generation rate
if (tempGenerated > 0) {
for (var i = 0; i < beatsToGenerate; i++) {
@@ -1127,11 +1142,9 @@
bigHeart.animateBeat();
}, i * 300);
}
}
- tapCount = self.money; // Update tapCount to reflect the current money
updateTapCountText(); // Update the text display
- //log("Tap count: ", tapCount); // Log the tap count
self.checkProgress(); // Check the progress
self.lastUpdateTime = now;
};
self.manualGeneration = function () {
@@ -1197,9 +1210,11 @@
if (!self.generators[generatorId]) {
self.generators[generatorId] = new Generator(generatorConfig);
self.generatorCounts[generatorId] = 0;
}
- self.money = addLargeNumbers(self.money, (-generatorConfig.cost).toString());
+ // Subtract cost using subtractLargeNumbers
+ self.money = subtractLargeNumbers(self.money, generatorConfig.cost.toString());
+ tapCount = self.money;
// Calculate new cost
var currentCount = self.generatorCounts[generatorId] || 0;
var baseCost = GENERATORS[Object.keys(GENERATORS)[generatorId]].cost;
var newCost = Math.floor(baseCost * Math.pow(self.priceIncreaseRate, currentCount + 1));
@@ -1224,9 +1239,11 @@
}
if (parseInt(tapCount) < upgradeConfig.cost) {
return false;
}
- self.money = addLargeNumbers(self.money, (-upgradeConfig.cost).toString());
+ // Subtract cost using subtractLargeNumbers
+ self.money = subtractLargeNumbers(self.money, upgradeConfig.cost.toString());
+ tapCount = self.money;
var upgrade = new Upgrade(upgradeConfig);
upgrade.apply(targetGenerator);
self.upgrades[upgradeId] = upgrade;
return true;
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