Code edit (5 edits merged)
Please save this source code
User prompt
Auto clicker upgraded 10 200k para 0.09 saniyede tıklasın 11 upgraded 250k 0.08 saniyede tıklasın 12 500k para 0.07 saniyede tıklasın 13 1M 0.06 Tıklasın 14 upgraded 2.5M 0.05 15 upgraded 5M 0.05 saniyede tıklasın 16 upgraded 10M 0.04 17 upgraded 0.03 saniyede tıklasın fiyat 20M 18 upgraded 0.02 saniyede tıklasin 19 upgraded 0.01 saniyede tıklasın fiyat 50 milyon olsun
Code edit (3 edits merged)
Please save this source code
User prompt
Auto clicker upgraded case 8 40000 puan istiyorum 0.2 saniyede tıklasın sonun upgraded 100000 0.1 saniyede tıklasın
Code edit (4 edits merged)
Please save this source code
User prompt
Poinst 400K
Code edit (1 edits merged)
Please save this source code
User prompt
Auto clicker add 7 level 20000 score 0.3 saniyede tıkla level 8 40000 aldın zaman 0.2 125k para 0.1 hızla tıklasın
Code edit (1 edits merged)
Please save this source code
User prompt
Poins per tap 1
User prompt
POİNST 91M
User prompt
Poins per tap 1
User prompt
Poinst 999M
User prompt
Auto clicker cost 1000
User prompt
auto clicker appears normally when you reach that amount of money, it appears before you reach that amount of money.
User prompt
Poinst per tap 1
User prompt
Poinst per tap 999
User prompt
Score 999k
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'AutoClickerButton is not defined' in or related to this line: 'var autoClickerButton = new AutoClickerButton();' Line Number: 253
User prompt
Auto clicker class delete
User prompt
Poinst per tap 1
User prompt
Poinst per tap 99
User prompt
points per tap 20
User prompt
Auto clicker delete class
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); var storage = LK.import("@upit/storage.v1", { score: 0, tapValue: 1, upgradeLevel: 1, upgradeCost: 10, hasAutoClicker: false, autoClickerLevel: 1 }); /**** * Classes ****/ var AutoClickerButton = Container.expand(function () { var self = Container.call(this); var buttonGraphic = self.attachAsset('upgradeButton', { anchorX: 0.5, anchorY: 0.5 }); self.text = new Text2('Auto Click: 1000', { size: 60, fill: 0xFFFFFF }); self.text.anchor.set(0.5, 0.5); self.addChild(self.text); // Properties self.active = false; self.timer = null; self.clickInterval = 1000; // Default 1 second self.level = 1; self.updateText = function (cost) { if (self.level >= 19) { self.text.setText('Auto Click: MAX'); } else { self.text.setText('Auto Click: ' + cost); } }; self.down = function () { tween(buttonGraphic, { scaleX: 0.95, scaleY: 0.95 }, { duration: 100, easing: tween.easeOut }); }; self.up = function () { tween(buttonGraphic, { scaleX: 1, scaleY: 1 }, { duration: 100, easing: tween.easeOut }); if (!hasAutoClicker) { attemptBuyAutoClicker(); } else if (self.level < 9) { attemptUpgradeAutoClicker(); } }; self.activate = function () { self.active = true; self.restartTimer(); }; self.restartTimer = function () { if (self.timer) { LK.clearInterval(self.timer); } self.timer = LK.setInterval(function () { if (tapValue > 0) { // Auto click adds points based on tap value score += tapValue; storage.score = score; updateScoreDisplay(); } }, self.clickInterval); }; self.upgrade = function () { self.level++; // Update click interval based on level switch (self.level) { case 2: self.clickInterval = 900; // 0.9 seconds break; case 3: self.clickInterval = 800; // 0.8 seconds break; case 4: self.clickInterval = 700; // 0.7 seconds break; case 5: self.clickInterval = 500; // 0.5 seconds break; case 6: self.clickInterval = 400; // 0.4 seconds break; case 7: self.clickInterval = 300; // 0.3 seconds break; case 8: self.clickInterval = 200; // 0.2 seconds break; case 9: self.clickInterval = 100; // 0.1 seconds break; case 10: self.clickInterval = 90; // 0.09 seconds break; case 11: self.clickInterval = 80; // 0.08 seconds break; case 12: self.clickInterval = 70; // 0.07 seconds break; case 13: self.clickInterval = 60; // 0.06 seconds break; case 14: self.clickInterval = 50; // 0.05 seconds break; case 15: self.clickInterval = 50; // 0.05 seconds break; case 16: self.clickInterval = 40; // 0.04 seconds break; case 17: self.clickInterval = 30; // 0.03 seconds break; case 18: self.clickInterval = 20; // 0.02 seconds break; case 19: self.clickInterval = 10; // 0.01 seconds break; } // Update cost display if (self.level < 19) { self.updateText(getAutoClickerUpgradeCost()); } else { self.updateText("MAX"); } // Restart timer with new interval if (self.active) { self.restartTimer(); } }; self.disable = function () { buttonGraphic.alpha = 0.5; }; self.enable = function () { buttonGraphic.alpha = 1; }; return self; }); var Coin = Container.expand(function () { var self = Container.call(this); var coinGraphic = self.attachAsset('coin', { anchorX: 0.5, anchorY: 0.5 }); // Pulse animation when active self.pulse = function () { // Stop any existing animation tween.stop(coinGraphic, { scaleX: true, scaleY: true }); // Scale up tween(coinGraphic, { scaleX: 1.2, scaleY: 1.2 }, { duration: 100, easing: tween.easeOut, onFinish: function onFinish() { // Scale back down tween(coinGraphic, { scaleX: 1, scaleY: 1 }, { duration: 200, easing: tween.elasticOut }); } }); }; return self; }); var ShockWave = Container.expand(function () { var self = Container.call(this); // Create the shock wave circle var waveGraphic = self.attachAsset('tapEffect', { anchorX: 0.5, anchorY: 0.5, alpha: 0.7 }); // Animation method for the shock wave self.animate = function (x, y) { // Set position self.x = x; self.y = y; // Start with small scale and high opacity waveGraphic.scaleX = 0.1; waveGraphic.scaleY = 0.1; waveGraphic.alpha = 0.8; // First expand the wave quickly tween(waveGraphic, { scaleX: 3, scaleY: 3, alpha: 0.6 }, { duration: 300, easing: tween.easeOut, onFinish: function onFinish() { // Then continue expanding and fade out tween(waveGraphic, { scaleX: 8, scaleY: 8, alpha: 0 }, { duration: 500, easing: tween.easeOut, onFinish: function onFinish() { // Remove when done if (self.parent) { self.parent.removeChild(self); } } }); } }); }; return self; }); var TapEffect = Container.expand(function () { var self = Container.call(this); var effectGraphic = self.attachAsset('tapEffect', { anchorX: 0.5, anchorY: 0.5, alpha: 0.7 }); self.animate = function (x, y, pointsEarned) { self.x = x; self.y = y; self.alpha = 1; effectGraphic.scaleX = 0.5; effectGraphic.scaleY = 0.5; // Create points text var pointsText = new Text2("+" + pointsEarned, { size: 60, fill: 0xFFFFFF }); pointsText.anchor.set(0.5, 0.5); self.addChild(pointsText); // Animate effect tween(effectGraphic, { scaleX: 1.5, scaleY: 1.5, alpha: 0 }, { duration: 500, easing: tween.easeOut }); // Animate text floating up tween(pointsText, { y: -100, alpha: 0 }, { duration: 800, easing: tween.easeOut, onFinish: function onFinish() { self.removeChild(pointsText); pointsText = null; } }); }; return self; }); var UpgradeButton = Container.expand(function () { var self = Container.call(this); var buttonGraphic = self.attachAsset('upgradeButton', { anchorX: 0.5, anchorY: 0.5 }); self.text = new Text2('Upgrade: 10 points', { size: 60, fill: 0xFFFFFF }); self.text.anchor.set(0.5, 0.5); self.addChild(self.text); self.updateText = function (cost) { self.text.setText('Upgrade: ' + cost + ' points'); }; self.down = function () { tween(buttonGraphic, { scaleX: 0.95, scaleY: 0.95 }, { duration: 100, easing: tween.easeOut }); }; self.up = function () { tween(buttonGraphic, { scaleX: 1, scaleY: 1 }, { duration: 100, easing: tween.easeOut }); attemptUpgrade(); }; self.disable = function () { buttonGraphic.alpha = 0.5; }; self.enable = function () { buttonGraphic.alpha = 1; }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 }); /**** * Game Code ****/ // Reset game variables to initial state var score = 0; var tapValue = 1; // 1 points per tap var upgradeLevel = 1; var upgradeCost = 10; var autoClickerLevel = 1; var autoClickerCost = 1000; var hasAutoClicker = false; // Save reset values to storage storage.score = 0; storage.tapValue = 999; // 1 points per tap storage.upgradeLevel = 1; storage.upgradeCost = 10; storage.autoClickerLevel = 1; storage.hasAutoClicker = false; var effects = []; // Function to get auto clicker upgrade cost based on level function getAutoClickerUpgradeCost() { switch (autoClickerLevel) { case 1: return 1000; // First upgrade costs 1000 case 2: return 2000; // Second upgrade costs 2000 case 3: return 5000; // Third upgrade costs 5000 case 4: return 10000; // Fourth upgrade costs 10000 case 5: return 20000; // Fifth upgrade costs 20000 case 6: return 40000; // Sixth upgrade costs 40000 case 7: return 40000; // Seventh upgrade costs 40000 case 8: return 100000; // Eighth upgrade costs 100000 case 9: return 200000; // Ninth upgrade costs 200K case 10: return 250000; // Tenth upgrade costs 250K case 11: return 500000; // Eleventh upgrade costs 500K case 12: return 1000000; // Twelfth upgrade costs 1M case 13: return 2500000; // Thirteenth upgrade costs 2.5M case 14: return 5000000; // Fourteenth upgrade costs 5M case 15: return 10000000; // Fifteenth upgrade costs 10M case 16: return 20000000; // Sixteenth upgrade costs 20M case 17: return 50000000; // Seventeenth upgrade costs 50M case 18: return 100000000; // Eighteenth upgrade costs 100M default: return Infinity; // No more upgrades } } // Create upgrade button in top left (but not too close to the corner) var upgradeButton = new UpgradeButton(); upgradeButton.x = 400; upgradeButton.y = 150; upgradeButton.updateText(upgradeCost); game.addChild(upgradeButton); // Create auto clicker button below the upgrade button var autoClickerButton = new AutoClickerButton(); autoClickerButton.x = 400; autoClickerButton.y = 320; autoClickerButton.updateText(1000); autoClickerButton.visible = false; // Hide by default, visibility will be controlled by updateAutoClickerVisibility() game.addChild(autoClickerButton); // Auto clicker button position is maintained at y=320 // Don't activate auto clicker by default as game is reset if (hasAutoClicker) { // Set the correct level and interval for purchased auto clicker autoClickerButton.level = autoClickerLevel; // Set default interval autoClickerButton.clickInterval = 1000; // 1 second (default speed) // Update click interval based on level switch (autoClickerLevel) { case 2: autoClickerButton.clickInterval = 900; // 0.9 seconds break; case 3: autoClickerButton.clickInterval = 800; // 0.8 seconds break; case 4: autoClickerButton.clickInterval = 700; // 0.7 seconds break; case 5: autoClickerButton.clickInterval = 500; // 0.5 seconds break; case 6: autoClickerButton.clickInterval = 400; // 0.4 seconds break; case 7: autoClickerButton.clickInterval = 300; // 0.3 seconds break; case 8: autoClickerButton.clickInterval = 200; // 0.2 seconds break; case 9: autoClickerButton.clickInterval = 100; // 0.1 seconds break; case 10: autoClickerButton.clickInterval = 90; // 0.09 seconds break; case 11: autoClickerButton.clickInterval = 80; // 0.08 seconds break; case 12: autoClickerButton.clickInterval = 70; // 0.07 seconds break; case 13: autoClickerButton.clickInterval = 60; // 0.06 seconds break; case 14: autoClickerButton.clickInterval = 50; // 0.05 seconds break; case 15: autoClickerButton.clickInterval = 50; // 0.05 seconds break; case 16: autoClickerButton.clickInterval = 40; // 0.04 seconds break; case 17: autoClickerButton.clickInterval = 30; // 0.03 seconds break; case 18: autoClickerButton.clickInterval = 20; // 0.02 seconds break; case 19: autoClickerButton.clickInterval = 10; // 0.01 seconds break; } autoClickerButton.activate(); } // Function to check if auto clicker should be visible function updateAutoClickerVisibility() { if (score >= autoClickerCost || hasAutoClicker) { autoClickerButton.visible = true; } else { autoClickerButton.visible = false; } } // Create score display var scoreText = new Text2('Points: 0', { size: 100, fill: 0xFFFFFF }); scoreText.anchor.set(0.5, 0); LK.gui.top.addChild(scoreText); // Create tap value display var tapValueText = new Text2('Points per tap: ' + tapValue, { size: 60, fill: 0xFFFFFF }); tapValueText.anchor.set(0.5, 0); tapValueText.y = 120; LK.gui.top.addChild(tapValueText); // Format large numbers with K, M, B, T suffixes function formatScore(num) { if (num >= 1000000000000) { // Trillion var t = num / 1000000000000; return (Math.floor(t * 10) / 10).toFixed(1).replace(/\.0$/, '') + 'T'; } else if (num >= 1000000000) { // Billion var b = num / 1000000000; return (Math.floor(b * 10) / 10).toFixed(1).replace(/\.0$/, '') + 'B'; } else if (num >= 1000000) { // Million var m = num / 1000000; return (Math.floor(m * 10) / 10).toFixed(1).replace(/\.0$/, '') + 'M'; } else if (num >= 1000) { // Thousand var k = num / 1000; return (Math.floor(k * 10) / 10).toFixed(1).replace(/\.0$/, '') + 'K'; } else { return num.toString(); } } // Update score display function updateScoreDisplay() { scoreText.setText('Points: ' + formatScore(score)); tapValueText.setText('Points per tap: ' + tapValue); // Check if player can afford upgrade if (score >= upgradeCost) { upgradeButton.enable(); } else { upgradeButton.disable(); } // Check if auto clicker should be visible updateAutoClickerVisibility(); // Restart auto clicker if tap value changed from 0 if (tapValue > 0 && autoClickerButton.active && !autoClickerButton.timer) { autoClickerButton.restartTimer(); } // Disable auto clicker functionality if tap value is 0 if (tapValue === 0 && autoClickerButton.active) { if (autoClickerButton.timer) { LK.clearInterval(autoClickerButton.timer); autoClickerButton.timer = null; } } // Enable/disable auto clicker button based on score if (!hasAutoClicker) { if (score >= autoClickerCost) { autoClickerButton.enable(); } else { autoClickerButton.disable(); } } else if (autoClickerLevel < 19) { // If has auto clicker but not max level, check if can afford upgrade var nextUpgradeCost = getAutoClickerUpgradeCost(); if (score >= nextUpgradeCost) { autoClickerButton.enable(); } else { autoClickerButton.disable(); } } } // Attempt to purchase an upgrade function attemptUpgrade() { if (score >= upgradeCost) { // Deduct points score -= upgradeCost; // Increase tap value upgradeLevel++; tapValue = upgradeLevel; // Calculate new upgrade cost (increase by 50%) upgradeCost = Math.floor(upgradeCost * 1.5); // Update button text upgradeButton.updateText(upgradeCost); // Save progress storage.score = score; storage.tapValue = tapValue; storage.upgradeLevel = upgradeLevel; storage.upgradeCost = upgradeCost; // Update display updateScoreDisplay(); // Play upgrade sound LK.getSound('upgrade').play(); } } // Attempt to purchase auto clicker function attemptBuyAutoClicker() { if (!hasAutoClicker && score >= autoClickerCost) { // Deduct points score -= autoClickerCost; // Activate auto clicker hasAutoClicker = true; storage.hasAutoClicker = true; storage.autoClickerLevel = 1; storage.score = score; // Update display updateScoreDisplay(); // Activate auto clicker functionality autoClickerButton.activate(); // Play upgrade sound LK.getSound('upgrade').play(); } } // Removed resetAutoClicker function // Attempt to upgrade auto clicker function attemptUpgradeAutoClicker() { // Don't proceed if already at max level if (autoClickerLevel >= 19) { return; } // Get the cost for the current level upgrade var upgradeCost = getAutoClickerUpgradeCost(); // Check if player can afford the upgrade if (score >= upgradeCost) { // Deduct points score -= upgradeCost; // Upgrade auto clicker autoClickerLevel++; // Save progress storage.score = score; storage.autoClickerLevel = autoClickerLevel; // Update auto clicker button autoClickerButton.upgrade(); // Update display updateScoreDisplay(); // Play upgrade sound LK.getSound('upgrade').play(); } } // Create tap effect function createTapEffect(x, y) { var effect = new TapEffect(); game.addChild(effect); effect.animate(x, y, tapValue); // Remove effect after animation LK.setTimeout(function () { if (effect.parent) { game.removeChild(effect); } }, 1000); } // Handle tapping on the game game.down = function (x, y) { // Check if tap value is greater than 0 if (tapValue > 0) { // Add points score += tapValue; // Save progress storage.score = score; // Create visual effect for points createTapEffect(x, y); } // Update display updateScoreDisplay(); // Create shock wave effect var shockWave = new ShockWave(); game.addChild(shockWave); shockWave.animate(x, y); // Play tap sound LK.getSound('tap').play(); }; // Load values from storage if (storage.score !== undefined) { score = storage.score; } if (storage.tapValue !== undefined) { tapValue = storage.tapValue; } if (storage.upgradeLevel !== undefined) { upgradeLevel = storage.upgradeLevel; } if (storage.upgradeCost !== undefined) { upgradeCost = storage.upgradeCost; } if (storage.hasAutoClicker !== undefined) { hasAutoClicker = storage.hasAutoClicker; } if (storage.autoClickerLevel !== undefined) { autoClickerLevel = storage.autoClickerLevel; } // Initial setup updateScoreDisplay(); updateAutoClickerVisibility(); // Play background music LK.playMusic('bgmusic', { fade: { start: 0, end: 0.3, duration: 1000 } });
===================================================================
--- original.js
+++ change.js
@@ -31,9 +31,9 @@
self.timer = null;
self.clickInterval = 1000; // Default 1 second
self.level = 1;
self.updateText = function (cost) {
- if (self.level >= 9) {
+ if (self.level >= 19) {
self.text.setText('Auto Click: MAX');
} else {
self.text.setText('Auto Click: ' + cost);
}
@@ -105,11 +105,41 @@
break;
case 9:
self.clickInterval = 100; // 0.1 seconds
break;
+ case 10:
+ self.clickInterval = 90; // 0.09 seconds
+ break;
+ case 11:
+ self.clickInterval = 80; // 0.08 seconds
+ break;
+ case 12:
+ self.clickInterval = 70; // 0.07 seconds
+ break;
+ case 13:
+ self.clickInterval = 60; // 0.06 seconds
+ break;
+ case 14:
+ self.clickInterval = 50; // 0.05 seconds
+ break;
+ case 15:
+ self.clickInterval = 50; // 0.05 seconds
+ break;
+ case 16:
+ self.clickInterval = 40; // 0.04 seconds
+ break;
+ case 17:
+ self.clickInterval = 30; // 0.03 seconds
+ break;
+ case 18:
+ self.clickInterval = 20; // 0.02 seconds
+ break;
+ case 19:
+ self.clickInterval = 10; // 0.01 seconds
+ break;
}
// Update cost display
- if (self.level < 9) {
+ if (self.level < 19) {
self.updateText(getAutoClickerUpgradeCost());
} else {
self.updateText("MAX");
}
@@ -303,18 +333,18 @@
/****
* Game Code
****/
// Reset game variables to initial state
-var score = 99999;
+var score = 0;
var tapValue = 1; // 1 points per tap
var upgradeLevel = 1;
var upgradeCost = 10;
var autoClickerLevel = 1;
var autoClickerCost = 1000;
var hasAutoClicker = false;
// Save reset values to storage
-storage.score = 999999;
-storage.tapValue = 1; // 1 points per tap
+storage.score = 0;
+storage.tapValue = 999; // 1 points per tap
storage.upgradeLevel = 1;
storage.upgradeCost = 10;
storage.autoClickerLevel = 1;
storage.hasAutoClicker = false;
@@ -345,8 +375,38 @@
// Seventh upgrade costs 40000
case 8:
return 100000;
// Eighth upgrade costs 100000
+ case 9:
+ return 200000;
+ // Ninth upgrade costs 200K
+ case 10:
+ return 250000;
+ // Tenth upgrade costs 250K
+ case 11:
+ return 500000;
+ // Eleventh upgrade costs 500K
+ case 12:
+ return 1000000;
+ // Twelfth upgrade costs 1M
+ case 13:
+ return 2500000;
+ // Thirteenth upgrade costs 2.5M
+ case 14:
+ return 5000000;
+ // Fourteenth upgrade costs 5M
+ case 15:
+ return 10000000;
+ // Fifteenth upgrade costs 10M
+ case 16:
+ return 20000000;
+ // Sixteenth upgrade costs 20M
+ case 17:
+ return 50000000;
+ // Seventeenth upgrade costs 50M
+ case 18:
+ return 100000000;
+ // Eighteenth upgrade costs 100M
default:
return Infinity;
// No more upgrades
}
@@ -396,8 +456,38 @@
break;
case 9:
autoClickerButton.clickInterval = 100; // 0.1 seconds
break;
+ case 10:
+ autoClickerButton.clickInterval = 90; // 0.09 seconds
+ break;
+ case 11:
+ autoClickerButton.clickInterval = 80; // 0.08 seconds
+ break;
+ case 12:
+ autoClickerButton.clickInterval = 70; // 0.07 seconds
+ break;
+ case 13:
+ autoClickerButton.clickInterval = 60; // 0.06 seconds
+ break;
+ case 14:
+ autoClickerButton.clickInterval = 50; // 0.05 seconds
+ break;
+ case 15:
+ autoClickerButton.clickInterval = 50; // 0.05 seconds
+ break;
+ case 16:
+ autoClickerButton.clickInterval = 40; // 0.04 seconds
+ break;
+ case 17:
+ autoClickerButton.clickInterval = 30; // 0.03 seconds
+ break;
+ case 18:
+ autoClickerButton.clickInterval = 20; // 0.02 seconds
+ break;
+ case 19:
+ autoClickerButton.clickInterval = 10; // 0.01 seconds
+ break;
}
autoClickerButton.activate();
}
// Function to check if auto clicker should be visible
@@ -474,9 +564,9 @@
autoClickerButton.enable();
} else {
autoClickerButton.disable();
}
- } else if (autoClickerLevel < 9) {
+ } else if (autoClickerLevel < 19) {
// If has auto clicker but not max level, check if can afford upgrade
var nextUpgradeCost = getAutoClickerUpgradeCost();
if (score >= nextUpgradeCost) {
autoClickerButton.enable();
@@ -529,9 +619,9 @@
// Removed resetAutoClicker function
// Attempt to upgrade auto clicker
function attemptUpgradeAutoClicker() {
// Don't proceed if already at max level
- if (autoClickerLevel >= 9) {
+ if (autoClickerLevel >= 19) {
return;
}
// Get the cost for the current level upgrade
var upgradeCost = getAutoClickerUpgradeCost();