Code edit (6 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 (1 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 (4 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
User prompt
I don't see gifts falling; I thing it misses and "attachement" to GiftRain
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -375,9 +375,9 @@
}
var endTime = Date.now();
var timeDiff = endTime - self.startTime;
var distance = Math.sqrt(Math.pow(x - self.startX, 2) + Math.pow(y - globalStartY, 2));
- if (timeDiff < 200 && distance < 10) {
+ if (timeDiff < TAP_DETECT_DELAY && distance < SWIPE_THRESHOLD) {
// Detected as a tap
log("Detected tap on Generator button");
// Check if tapCount is less than the cost of the generator
if (tapCount < self.config.cost) {
@@ -497,8 +497,9 @@
if (gift.y > 3000) {
log("Gift moved out of bounds and will be recycled. Position: ", gift.x, gift.y);
gift.x = Math.random() * (1948 - 100) + 100;
gift.y = -300; // Start above the screen
+ gift.rotation = Math.random() * (Math.PI / 2) - Math.PI / 4; // Set random rotation between -PI/4 and +PI/4
gift.visible = true;
}
}
};
@@ -714,31 +715,34 @@
}
if (dragNode === self || dragNode instanceof GeneratorButton) {
// Check if a button or rightBoard is being dragged
var deltaY = y - globalStartY; // Calculate deltaY based on movement
- log("Move detected with deltaY:", deltaY);
- // Calculate new positions for the first and last buttons
- var firstButtonNewY = self.y + self.generatorButtons[0].y + deltaY;
- var lastButtonNewY = self.y + self.generatorButtons[self.generatorButtons.length - 1].y + deltaY;
- log("firstButtonNewY:", firstButtonNewY, "lastButtonNewY:", lastButtonNewY);
- // Check if the first button stays above the screen center and the last button stays below the screen center
- // Adjust deltaY to prevent moving beyond boundaries
- if (deltaY > 0) {
- deltaY = Math.min(deltaY, 1000 - (self.y + self.generatorButtons[0].y));
+ // Only apply movement if the delta exceeds the swipe threshold
+ if (Math.abs(deltaY) > SWIPE_THRESHOLD) {
+ log("Move detected with deltaY:", deltaY);
+ // Calculate new positions for the first and last buttons
+ var firstButtonNewY = self.y + self.generatorButtons[0].y + deltaY;
+ var lastButtonNewY = self.y + self.generatorButtons[self.generatorButtons.length - 1].y + deltaY;
+ log("firstButtonNewY:", firstButtonNewY, "lastButtonNewY:", lastButtonNewY);
+ // Check if the first button stays above the screen center and the last button stays below the screen center
+ // Adjust deltaY to prevent moving beyond boundaries
+ if (deltaY > 0) {
+ deltaY = Math.min(deltaY, 1000 - (self.y + self.generatorButtons[0].y));
+ }
+ // Move all generator buttons vertically based on swipe direction
+ self.generatorButtons.forEach(function (button) {
+ button.y += deltaY;
+ });
+ self.swipeOffset += deltaY; // Update the total swipe offset
+ globalStartY = y; // Update globalStartY for continuous movement
}
- // Move all generator buttons vertically based on swipe direction
- self.generatorButtons.forEach(function (button) {
- button.y += deltaY;
- });
- self.swipeOffset += deltaY; // Update the total swipe offset
- globalStartY = y; // Update globalStartY for continuous movement
}
};
self.up = function (x, y, obj) {
var endTime = Date.now();
var timeDiff = endTime - self.startTime;
var distance = Math.sqrt(Math.pow(x - self.startX, 2) + Math.pow(y - globalStartY, 2));
- if (timeDiff < 200 && distance < 10) {
+ if (timeDiff < TAP_DETECT_DELAY && distance < SWIPE_THRESHOLD) {
// Detected as a tap
log("Detected tap on RightBoard");
} else {
// Start momentum animation
@@ -774,26 +778,29 @@
self.move = function (x, y, obj) {
if (dragNode === self || dragNode instanceof GeneratorButton) {
// Check if a button or rightBoard is being dragged
var deltaY = y - globalStartY; // Calculate deltaY based on movement
- log("Move detected with deltaY:", deltaY);
- // Calculate new positions for the first and last buttons
- var firstButtonNewY = self.y + self.generatorButtons[0].y + deltaY;
- var lastButtonNewY = self.y + self.generatorButtons[self.generatorButtons.length - 1].y + deltaY;
- log("firstButtonNewY:", firstButtonNewY, "lastButtonNewY:", lastButtonNewY);
- // Adjust deltaY to prevent moving beyond boundaries
- if (deltaY > 0) {
- deltaY = Math.min(deltaY, 1000 - (self.y + self.generatorButtons[0].y));
+ // Only apply movement if the delta exceeds the swipe threshold
+ if (Math.abs(deltaY) > SWIPE_THRESHOLD) {
+ log("Move detected with deltaY:", deltaY);
+ // Calculate new positions for the first and last buttons
+ var firstButtonNewY = self.y + self.generatorButtons[0].y + deltaY;
+ var lastButtonNewY = self.y + self.generatorButtons[self.generatorButtons.length - 1].y + deltaY;
+ log("firstButtonNewY:", firstButtonNewY, "lastButtonNewY:", lastButtonNewY);
+ // Adjust deltaY to prevent moving beyond boundaries
+ if (deltaY > 0) {
+ deltaY = Math.min(deltaY, 1000 - (self.y + self.generatorButtons[0].y));
+ }
+ if (deltaY < 0) {
+ deltaY = Math.max(deltaY, 1366 - (self.y + self.generatorButtons[self.generatorButtons.length - 1].y));
+ }
+ // Move all generator buttons vertically based on swipe direction
+ self.generatorButtons.forEach(function (button) {
+ button.y += deltaY;
+ });
+ self.swipeOffset += deltaY; // Update the total swipe offset
+ globalStartY = y; // Update globalStartY for continuous movement
}
- if (deltaY < 0) {
- deltaY = Math.max(deltaY, 1366 - (self.y + self.generatorButtons[self.generatorButtons.length - 1].y));
- }
- // Move all generator buttons vertically based on swipe direction
- self.generatorButtons.forEach(function (button) {
- button.y += deltaY;
- });
- self.swipeOffset += deltaY; // Update the total swipe offset
- globalStartY = y; // Update globalStartY for continuous movement
}
};
});
@@ -826,9 +833,10 @@
id: 0,
name: "Rose",
description: "A charming rose that generates a few love beats",
autoClick: true,
- clickRate: 1,
+ clickRate: 999999999,
+ //1, // TEMP DEBUG !!!
// 1 click per 10 seconds
cost: 10,
upgradeLevel: 0
},
@@ -917,12 +925,14 @@
}
});
}
var isDebug = true;
+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;
// Declare tapCount as a global variable
-var tapCount = 0;
+var tapCount = 9999999999;
var nbHearts = 10;
var backgroundContainer = new Container();
var middlegroundContainer = new Container();
middlegroundContainer.x = 0;
@@ -957,11 +967,28 @@
middlegroundContainer.addChild(bigHeart);
// Add a RightBoard instance to the foreground container
var rightBoard = new RightBoard();
foregroundContainer.addChild(rightBoard);
+function formatTapCount(taps) {
+ //return taps;
+ var suffixes = ['', 'B', 'T', 'Q', 'QT', 'S'];
+ var tier = 0;
+ // Find the appropriate suffix tier
+ while (taps >= 10000000000 && tier < suffixes.length - 1) {
+ taps /= 1000;
+ tier++;
+ }
+ // If less than 10B, return the number with commas
+ if (tier === 0) {
+ return taps.toLocaleString();
+ }
+ // Format with 3 decimal places and the appropriate suffix
+ log(taps + " => " + (Math.floor(taps * 1000) / 1000).toFixed(3) + ' ' + suffixes[tier]);
+ return (Math.floor(taps * 1000) / 1000).toFixed(3) + ' ' + suffixes[tier];
+}
// Update the tapCountText whenever tapCount changes
function updateTapCountText() {
- tapCountText.setText('LOVE\r\n' + tapCount);
+ tapCountText.setText('LOVE\r\n' + formatTapCount(tapCount));
}
// Global ProgressManager
function _typeof(o) {
"@babel/helpers - typeof";
@@ -1010,9 +1037,9 @@
function ProgressManager() {
var self = this;
self.maxHeartBeatsPerSecond = 8; // Add maxHeartBeatsPerSecond property
self.priceIncreaseRate = 1.33; // Extracted price increase rate
- self.money = 0;
+ self.money = tapCount; // // TEMP DEBUG !!!// TEMP DEBUG !!!
self.generators = {};
self.generatorCounts = {}; // Add a counter for each generator
self.upgrades = {};
self.currentTime = Date.now();
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
beautifull red gift box.
black plastic 3d triangle. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
basic red horizontal rectangle button with white text "RESET".