Code edit (1 edits merged)
Please save this source code
User prompt
Every time you get a coin can the coin jump out from the bottom and then bounces up to the coin counter and then the counter updates βͺπ‘ Consider importing and using the following plugins: @upit/tween.v1
User prompt
Now make the store button under the tab section
User prompt
It is still very crowded and also in the store and the cards tab the things are on the coin counter
User prompt
Still very crowded
User prompt
The cards section is very crowded can you spread thing out a bit
User prompt
Can you move the coin and click counter down
User prompt
Make the buttons more detailed with shadow
User prompt
Can you refresh the colour scheme
User prompt
Can you make the button a bit bigger and the text on the button a bit smaller
User prompt
Can you make the text on the button smaller so you can fit the longer text
User prompt
Can you now make the whole thing much bigger
User prompt
In the cards tab can you keep the store button but instead of a card slots button can you make the card slots in the cards tab
User prompt
Now can you make the cards tab a menu in infinity and the store in a menu in cards
User prompt
Can you remove the timed section
User prompt
Can you make coins have a specific chance to come every time you click the button
User prompt
Please fix the bug: 'Script error.' in or related to this line: 'storage.ownedCards = ownedCards;' Line Number: 362 βͺπ‘ Consider importing and using the following plugins: @upit/storage.v1
User prompt
Please fix the bug: 'Script error.' in or related to this line: 'storage.ownedCards = ownedCards;' Line Number: 361
User prompt
Can you remove the booster and make a tab called cards where you can buy cards in a tab called store and you can use the cards by putting them i a slot in the cards tab where you can buy more slots the cards will be things like "15% chance to get a critical hit" or "one click per second automatically" βͺπ‘ Consider importing and using the following plugins: @upit/storage.v1, @upit/tween.v1
User prompt
Can you add boosters like 3x click for 3 min or auto clicker for 10 sec βͺπ‘ Consider importing and using the following plugins: @upit/tween.v1, @upit/storage.v1
User prompt
Could we make a login system to save your progress βͺπ‘ Consider importing and using the following plugins: @upit/storage.v1
User prompt
Can you havea random jumscare every hundred βͺπ‘ Consider importing and using the following plugins: @upit/tween.v1
User prompt
Can you add jumscares at every hundred on infinity βͺπ‘ Consider importing and using the following plugins: @upit/tween.v1
User prompt
Could we now ad some background music
User prompt
I can't hear anything
/**** * Plugins ****/ var storage = LK.import("@upit/storage.v1"); var tween = LK.import("@upit/tween.v1"); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 }); /**** * Game Code ****/ var currentTab = storage.currentTab || 'infinity'; var clickCount = storage.clickCount || 0; var timedClickCount = 0; var timeRemaining = 0; var gameActive = false; var highScore = storage.timedHighScore || 0; var timer = null; // Booster variables var tripleClickActive = false; var tripleClickTimer = null; var autoClickerActive = false; var autoClickerTimer = null; var autoClickerInterval = null; var boosterCoins = storage.boosterCoins || 0; // Create tab buttons var infinityTab = game.addChild(LK.getAsset('button', { anchorX: 0.5, anchorY: 0.5, width: 250, height: 80 })); infinityTab.x = 2048 / 2 - 150; infinityTab.y = 200; var timedTab = game.addChild(LK.getAsset('button', { anchorX: 0.5, anchorY: 0.5, width: 250, height: 80 })); timedTab.x = 2048 / 2 + 150; timedTab.y = 200; // Tab text var infinityTabText = new Text2('INFINITY', { size: 40, fill: 0x000000 }); infinityTabText.anchor.set(0.5, 0.5); infinityTabText.x = infinityTab.x; infinityTabText.y = infinityTab.y; game.addChild(infinityTabText); var timedTabText = new Text2('TIMED', { size: 40, fill: 0x000000 }); timedTabText.anchor.set(0.5, 0.5); timedTabText.x = timedTab.x; timedTabText.y = timedTab.y; game.addChild(timedTabText); // Create the main button var button = game.addChild(LK.getAsset('button', { anchorX: 0.5, anchorY: 0.5 })); // Position button in center of screen button.x = 2048 / 2; button.y = 2732 / 2 - 100; // Array of random button texts var buttonTexts = ['CLICK ME!', 'TAP HERE!', 'PRESS ME!', 'HIT IT!', 'CLICK NOW!', 'TAP AWAY!', 'PUSH IT!', 'GO AHEAD!', 'CLICK THIS!', 'TAP TAP!']; // Create button text with random initial text var buttonText = new Text2(buttonTexts[Math.floor(Math.random() * buttonTexts.length)], { size: 60, fill: 0x000000 }); buttonText.anchor.set(0.5, 0.5); buttonText.x = button.x; buttonText.y = button.y; game.addChild(buttonText); // Create counter text var counterText = new Text2('Clicks: 0', { size: 80, fill: 0xffffff }); counterText.anchor.set(0.5, 0.5); counterText.x = 2048 / 2; counterText.y = 2732 / 2 + 100; game.addChild(counterText); // Create timer text for timed mode var timerText = new Text2('Time: 0', { size: 60, fill: 0xffffff }); timerText.anchor.set(0.5, 0.5); timerText.x = 2048 / 2; timerText.y = 2732 / 2 - 200; timerText.visible = false; game.addChild(timerText); // Create high score text for timed mode var highScoreText = new Text2('High Score: ' + highScore, { size: 50, fill: 0xffffff }); highScoreText.anchor.set(0.5, 0.5); highScoreText.x = 2048 / 2; highScoreText.y = 2732 / 2 + 200; highScoreText.visible = false; game.addChild(highScoreText); // Create booster UI var coinsText = new Text2('Coins: ' + boosterCoins, { size: 50, fill: 0xffff00 }); coinsText.anchor.set(0.5, 0.5); coinsText.x = 2048 / 2; coinsText.y = 400; game.addChild(coinsText); // Create booster buttons var tripleClickButton = game.addChild(LK.getAsset('button', { anchorX: 0.5, anchorY: 0.5, width: 280, height: 60 })); tripleClickButton.x = 2048 / 2 - 200; tripleClickButton.y = 500; var tripleClickButtonText = new Text2('3x Click (50 coins)', { size: 35, fill: 0x000000 }); tripleClickButtonText.anchor.set(0.5, 0.5); tripleClickButtonText.x = tripleClickButton.x; tripleClickButtonText.y = tripleClickButton.y; game.addChild(tripleClickButtonText); var autoClickerButton = game.addChild(LK.getAsset('button', { anchorX: 0.5, anchorY: 0.5, width: 280, height: 60 })); autoClickerButton.x = 2048 / 2 + 200; autoClickerButton.y = 500; var autoClickerButtonText = new Text2('Auto Click (100 coins)', { size: 35, fill: 0x000000 }); autoClickerButtonText.anchor.set(0.5, 0.5); autoClickerButtonText.x = autoClickerButton.x; autoClickerButtonText.y = autoClickerButton.y; game.addChild(autoClickerButtonText); // Create booster status texts var tripleClickStatus = new Text2('', { size: 40, fill: 0x00ff00 }); tripleClickStatus.anchor.set(0.5, 0.5); tripleClickStatus.x = 2048 / 2 - 200; tripleClickStatus.y = 580; game.addChild(tripleClickStatus); var autoClickerStatus = new Text2('', { size: 40, fill: 0x00ff00 }); autoClickerStatus.anchor.set(0.5, 0.5); autoClickerStatus.x = 2048 / 2 + 200; autoClickerStatus.y = 580; game.addChild(autoClickerStatus); // Function to update tab visibility function updateTabDisplay() { if (currentTab === 'infinity') { // Show infinity mode elements button.visible = true; buttonText.visible = true; counterText.visible = true; counterText.setText('Clicks: ' + clickCount); // Hide timed mode elements timerText.visible = false; highScoreText.visible = false; // Show booster elements for infinity mode coinsText.visible = true; tripleClickButton.visible = true; tripleClickButtonText.visible = true; autoClickerButton.visible = true; autoClickerButtonText.visible = true; tripleClickStatus.visible = true; autoClickerStatus.visible = true; // Update tab colors infinityTab.tint = 0x888888; timedTab.tint = 0xffffff; } else { // Show timed mode elements button.visible = true; buttonText.visible = true; counterText.visible = true; timerText.visible = true; highScoreText.visible = true; // Hide booster elements for timed mode coinsText.visible = false; tripleClickButton.visible = false; tripleClickButtonText.visible = false; autoClickerButton.visible = false; autoClickerButtonText.visible = false; tripleClickStatus.visible = false; autoClickerStatus.visible = false; // Update displays counterText.setText('Clicks: ' + timedClickCount); timerText.setText('Time: ' + timeRemaining); highScoreText.setText('High Score: ' + highScore); // Update tab colors infinityTab.tint = 0xffffff; timedTab.tint = 0x888888; if (!gameActive && timeRemaining === 0) { buttonText.setText('START GAME'); } } } // Function to start timed game function startTimedGame() { timedClickCount = 0; timeRemaining = Math.floor(Math.random() * 16) + 15; // Random time between 15-30 seconds gameActive = true; timer = LK.setInterval(function () { timeRemaining--; timerText.setText('Time: ' + timeRemaining); if (timeRemaining <= 0) { endTimedGame(); } }, 1000); updateTabDisplay(); } // Function to end timed game function endTimedGame() { gameActive = false; if (timer) { LK.clearInterval(timer); timer = null; } if (timedClickCount > highScore) { highScore = timedClickCount; storage.timedHighScore = highScore; } buttonText.setText('GAME OVER! Click to restart'); updateTabDisplay(); } // Tab click handlers infinityTab.down = function () { currentTab = 'infinity'; storage.currentTab = currentTab; updateTabDisplay(); }; timedTab.down = function () { currentTab = 'timed'; storage.currentTab = currentTab; updateTabDisplay(); }; // Booster button handlers tripleClickButton.down = function () { if (currentTab === 'infinity' && boosterCoins >= 50 && !tripleClickActive) { boosterCoins -= 50; storage.boosterCoins = boosterCoins; coinsText.setText('Coins: ' + boosterCoins); tripleClickActive = true; var timeLeft = 180; // 3 minutes in seconds tripleClickTimer = LK.setInterval(function () { timeLeft--; tripleClickStatus.setText('3x Active: ' + Math.floor(timeLeft / 60) + ':' + (timeLeft % 60).toString().padStart(2, '0')); if (timeLeft <= 0) { tripleClickActive = false; tripleClickStatus.setText(''); LK.clearInterval(tripleClickTimer); tripleClickTimer = null; } }, 1000); // Visual feedback tween(tripleClickButton, { tint: 0x00ff00 }, { duration: 200 }); LK.setTimeout(function () { tween(tripleClickButton, { tint: 0xffffff }, { duration: 200 }); }, 200); } }; autoClickerButton.down = function () { if (currentTab === 'infinity' && boosterCoins >= 100 && !autoClickerActive) { boosterCoins -= 100; storage.boosterCoins = boosterCoins; coinsText.setText('Coins: ' + boosterCoins); autoClickerActive = true; var timeLeft = 10; // 10 seconds autoClickerInterval = LK.setInterval(function () { // Auto click clickCount += tripleClickActive ? 3 : 1; storage.clickCount = clickCount; counterText.setText('Clicks: ' + clickCount); // Check for jumpscare at every hundred if (clickCount % 100 === 0) { triggerJumpscare(); } // Award coins every 10 clicks if (clickCount % 10 === 0) { boosterCoins++; storage.boosterCoins = boosterCoins; coinsText.setText('Coins: ' + boosterCoins); } LK.getSound('click').play(); }, 200); // Auto click every 200ms autoClickerTimer = LK.setInterval(function () { timeLeft--; autoClickerStatus.setText('Auto: ' + timeLeft + 's'); if (timeLeft <= 0) { autoClickerActive = false; autoClickerStatus.setText(''); LK.clearInterval(autoClickerTimer); LK.clearInterval(autoClickerInterval); autoClickerTimer = null; autoClickerInterval = null; } }, 1000); // Visual feedback tween(autoClickerButton, { tint: 0x00ff00 }, { duration: 200 }); LK.setTimeout(function () { tween(autoClickerButton, { tint: 0xffffff }, { duration: 200 }); }, 200); } }; // Function to trigger jumpscare function triggerJumpscare() { // Array of scary messages var scaryMessages = ['BOO!', 'GOTCHA!', 'SURPRISE!', 'SCARED YET?', 'JUMP!', 'AAAHHH!', 'SPOOKY!', 'FEAR ME!']; var randomMessage = scaryMessages[Math.floor(Math.random() * scaryMessages.length)]; // Random jumpscare type (0-3) var jumpscareType = Math.floor(Math.random() * 4); if (jumpscareType === 0) { // Type 1: Red flash with dramatic scale and shake LK.effects.flashScreen(0xff0000, 500); tween(button, { scaleX: 3, scaleY: 3 }, { duration: 200, easing: tween.bounceOut }); tween(button, { x: button.x + Math.random() * 40 - 20, y: button.y + Math.random() * 40 - 20 }, { duration: 50 }); } else if (jumpscareType === 1) { // Type 2: Purple flash with spin and grow LK.effects.flashScreen(0x800080, 700); tween(button, { scaleX: 2.5, scaleY: 2.5, rotation: Math.PI * 2 }, { duration: 400, easing: tween.elasticOut }); } else if (jumpscareType === 2) { // Type 3: Orange flash with rapid shake LK.effects.flashScreen(0xff4500, 600); var shakeCount = 0; var shakeInterval = LK.setInterval(function () { button.x = 2048 / 2 + Math.random() * 60 - 30; button.y = 2732 / 2 - 100 + Math.random() * 60 - 30; shakeCount++; if (shakeCount >= 10) { LK.clearInterval(shakeInterval); } }, 30); } else { // Type 4: Green flash with wild scaling LK.effects.flashScreen(0x00ff00, 400); tween(button, { scaleX: 4, scaleY: 0.5 }, { duration: 150, easing: tween.easeIn }); LK.setTimeout(function () { tween(button, { scaleX: 0.5, scaleY: 4 }, { duration: 150, easing: tween.easeOut }); }, 150); } // Scale back down after a moment LK.setTimeout(function () { tween(button, { scaleX: 1, scaleY: 1, rotation: 0, x: 2048 / 2, y: 2732 / 2 - 100 }, { duration: 300, easing: tween.easeOut }); }, 300); // Change button text to random scary message buttonText.setText(randomMessage + ' ' + clickCount + ' CLICKS!'); } // Handle button clicks button.down = function (x, y, obj) { if (currentTab === 'infinity') { var clicksToAdd = tripleClickActive ? 3 : 1; clickCount += clicksToAdd; storage.clickCount = clickCount; counterText.setText('Clicks: ' + clickCount); // Award coins every 10 clicks if (clickCount % 10 === 0) { boosterCoins++; storage.boosterCoins = boosterCoins; coinsText.setText('Coins: ' + boosterCoins); } // Check for jumpscare at every hundred if (clickCount % 100 === 0) { triggerJumpscare(); } else { // Change button text to random message buttonText.setText(buttonTexts[Math.floor(Math.random() * buttonTexts.length)]); } // Play click sound LK.getSound('click').play(); } else { // Timed mode if (!gameActive && timeRemaining === 0) { startTimedGame(); } else if (gameActive) { timedClickCount++; counterText.setText('Clicks: ' + timedClickCount); // Change button text to random message buttonText.setText(buttonTexts[Math.floor(Math.random() * buttonTexts.length)]); // Play click sound LK.getSound('click').play(); } else { // Game over, restart startTimedGame(); } } // Visual feedback - scale button down slightly button.scaleX = 0.95; button.scaleY = 0.95; }; button.up = function (x, y, obj) { // Return button to normal size button.scaleX = 1.0; button.scaleY = 1.0; }; // Initialize the display updateTabDisplay(); // Start background music LK.playMusic('background');
===================================================================
--- original.js
+++ change.js
@@ -20,8 +20,15 @@
var timeRemaining = 0;
var gameActive = false;
var highScore = storage.timedHighScore || 0;
var timer = null;
+// Booster variables
+var tripleClickActive = false;
+var tripleClickTimer = null;
+var autoClickerActive = false;
+var autoClickerTimer = null;
+var autoClickerInterval = null;
+var boosterCoins = storage.boosterCoins || 0;
// Create tab buttons
var infinityTab = game.addChild(LK.getAsset('button', {
anchorX: 0.5,
anchorY: 0.5,
@@ -102,8 +109,67 @@
highScoreText.x = 2048 / 2;
highScoreText.y = 2732 / 2 + 200;
highScoreText.visible = false;
game.addChild(highScoreText);
+// Create booster UI
+var coinsText = new Text2('Coins: ' + boosterCoins, {
+ size: 50,
+ fill: 0xffff00
+});
+coinsText.anchor.set(0.5, 0.5);
+coinsText.x = 2048 / 2;
+coinsText.y = 400;
+game.addChild(coinsText);
+// Create booster buttons
+var tripleClickButton = game.addChild(LK.getAsset('button', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ width: 280,
+ height: 60
+}));
+tripleClickButton.x = 2048 / 2 - 200;
+tripleClickButton.y = 500;
+var tripleClickButtonText = new Text2('3x Click (50 coins)', {
+ size: 35,
+ fill: 0x000000
+});
+tripleClickButtonText.anchor.set(0.5, 0.5);
+tripleClickButtonText.x = tripleClickButton.x;
+tripleClickButtonText.y = tripleClickButton.y;
+game.addChild(tripleClickButtonText);
+var autoClickerButton = game.addChild(LK.getAsset('button', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ width: 280,
+ height: 60
+}));
+autoClickerButton.x = 2048 / 2 + 200;
+autoClickerButton.y = 500;
+var autoClickerButtonText = new Text2('Auto Click (100 coins)', {
+ size: 35,
+ fill: 0x000000
+});
+autoClickerButtonText.anchor.set(0.5, 0.5);
+autoClickerButtonText.x = autoClickerButton.x;
+autoClickerButtonText.y = autoClickerButton.y;
+game.addChild(autoClickerButtonText);
+// Create booster status texts
+var tripleClickStatus = new Text2('', {
+ size: 40,
+ fill: 0x00ff00
+});
+tripleClickStatus.anchor.set(0.5, 0.5);
+tripleClickStatus.x = 2048 / 2 - 200;
+tripleClickStatus.y = 580;
+game.addChild(tripleClickStatus);
+var autoClickerStatus = new Text2('', {
+ size: 40,
+ fill: 0x00ff00
+});
+autoClickerStatus.anchor.set(0.5, 0.5);
+autoClickerStatus.x = 2048 / 2 + 200;
+autoClickerStatus.y = 580;
+game.addChild(autoClickerStatus);
// Function to update tab visibility
function updateTabDisplay() {
if (currentTab === 'infinity') {
// Show infinity mode elements
@@ -113,8 +179,16 @@
counterText.setText('Clicks: ' + clickCount);
// Hide timed mode elements
timerText.visible = false;
highScoreText.visible = false;
+ // Show booster elements for infinity mode
+ coinsText.visible = true;
+ tripleClickButton.visible = true;
+ tripleClickButtonText.visible = true;
+ autoClickerButton.visible = true;
+ autoClickerButtonText.visible = true;
+ tripleClickStatus.visible = true;
+ autoClickerStatus.visible = true;
// Update tab colors
infinityTab.tint = 0x888888;
timedTab.tint = 0xffffff;
} else {
@@ -123,8 +197,16 @@
buttonText.visible = true;
counterText.visible = true;
timerText.visible = true;
highScoreText.visible = true;
+ // Hide booster elements for timed mode
+ coinsText.visible = false;
+ tripleClickButton.visible = false;
+ tripleClickButtonText.visible = false;
+ autoClickerButton.visible = false;
+ autoClickerButtonText.visible = false;
+ tripleClickStatus.visible = false;
+ autoClickerStatus.visible = false;
// Update displays
counterText.setText('Clicks: ' + timedClickCount);
timerText.setText('Time: ' + timeRemaining);
highScoreText.setText('High Score: ' + highScore);
@@ -174,95 +256,190 @@
currentTab = 'timed';
storage.currentTab = currentTab;
updateTabDisplay();
};
+// Booster button handlers
+tripleClickButton.down = function () {
+ if (currentTab === 'infinity' && boosterCoins >= 50 && !tripleClickActive) {
+ boosterCoins -= 50;
+ storage.boosterCoins = boosterCoins;
+ coinsText.setText('Coins: ' + boosterCoins);
+ tripleClickActive = true;
+ var timeLeft = 180; // 3 minutes in seconds
+ tripleClickTimer = LK.setInterval(function () {
+ timeLeft--;
+ tripleClickStatus.setText('3x Active: ' + Math.floor(timeLeft / 60) + ':' + (timeLeft % 60).toString().padStart(2, '0'));
+ if (timeLeft <= 0) {
+ tripleClickActive = false;
+ tripleClickStatus.setText('');
+ LK.clearInterval(tripleClickTimer);
+ tripleClickTimer = null;
+ }
+ }, 1000);
+ // Visual feedback
+ tween(tripleClickButton, {
+ tint: 0x00ff00
+ }, {
+ duration: 200
+ });
+ LK.setTimeout(function () {
+ tween(tripleClickButton, {
+ tint: 0xffffff
+ }, {
+ duration: 200
+ });
+ }, 200);
+ }
+};
+autoClickerButton.down = function () {
+ if (currentTab === 'infinity' && boosterCoins >= 100 && !autoClickerActive) {
+ boosterCoins -= 100;
+ storage.boosterCoins = boosterCoins;
+ coinsText.setText('Coins: ' + boosterCoins);
+ autoClickerActive = true;
+ var timeLeft = 10; // 10 seconds
+ autoClickerInterval = LK.setInterval(function () {
+ // Auto click
+ clickCount += tripleClickActive ? 3 : 1;
+ storage.clickCount = clickCount;
+ counterText.setText('Clicks: ' + clickCount);
+ // Check for jumpscare at every hundred
+ if (clickCount % 100 === 0) {
+ triggerJumpscare();
+ }
+ // Award coins every 10 clicks
+ if (clickCount % 10 === 0) {
+ boosterCoins++;
+ storage.boosterCoins = boosterCoins;
+ coinsText.setText('Coins: ' + boosterCoins);
+ }
+ LK.getSound('click').play();
+ }, 200); // Auto click every 200ms
+ autoClickerTimer = LK.setInterval(function () {
+ timeLeft--;
+ autoClickerStatus.setText('Auto: ' + timeLeft + 's');
+ if (timeLeft <= 0) {
+ autoClickerActive = false;
+ autoClickerStatus.setText('');
+ LK.clearInterval(autoClickerTimer);
+ LK.clearInterval(autoClickerInterval);
+ autoClickerTimer = null;
+ autoClickerInterval = null;
+ }
+ }, 1000);
+ // Visual feedback
+ tween(autoClickerButton, {
+ tint: 0x00ff00
+ }, {
+ duration: 200
+ });
+ LK.setTimeout(function () {
+ tween(autoClickerButton, {
+ tint: 0xffffff
+ }, {
+ duration: 200
+ });
+ }, 200);
+ }
+};
+// Function to trigger jumpscare
+function triggerJumpscare() {
+ // Array of scary messages
+ var scaryMessages = ['BOO!', 'GOTCHA!', 'SURPRISE!', 'SCARED YET?', 'JUMP!', 'AAAHHH!', 'SPOOKY!', 'FEAR ME!'];
+ var randomMessage = scaryMessages[Math.floor(Math.random() * scaryMessages.length)];
+ // Random jumpscare type (0-3)
+ var jumpscareType = Math.floor(Math.random() * 4);
+ if (jumpscareType === 0) {
+ // Type 1: Red flash with dramatic scale and shake
+ LK.effects.flashScreen(0xff0000, 500);
+ tween(button, {
+ scaleX: 3,
+ scaleY: 3
+ }, {
+ duration: 200,
+ easing: tween.bounceOut
+ });
+ tween(button, {
+ x: button.x + Math.random() * 40 - 20,
+ y: button.y + Math.random() * 40 - 20
+ }, {
+ duration: 50
+ });
+ } else if (jumpscareType === 1) {
+ // Type 2: Purple flash with spin and grow
+ LK.effects.flashScreen(0x800080, 700);
+ tween(button, {
+ scaleX: 2.5,
+ scaleY: 2.5,
+ rotation: Math.PI * 2
+ }, {
+ duration: 400,
+ easing: tween.elasticOut
+ });
+ } else if (jumpscareType === 2) {
+ // Type 3: Orange flash with rapid shake
+ LK.effects.flashScreen(0xff4500, 600);
+ var shakeCount = 0;
+ var shakeInterval = LK.setInterval(function () {
+ button.x = 2048 / 2 + Math.random() * 60 - 30;
+ button.y = 2732 / 2 - 100 + Math.random() * 60 - 30;
+ shakeCount++;
+ if (shakeCount >= 10) {
+ LK.clearInterval(shakeInterval);
+ }
+ }, 30);
+ } else {
+ // Type 4: Green flash with wild scaling
+ LK.effects.flashScreen(0x00ff00, 400);
+ tween(button, {
+ scaleX: 4,
+ scaleY: 0.5
+ }, {
+ duration: 150,
+ easing: tween.easeIn
+ });
+ LK.setTimeout(function () {
+ tween(button, {
+ scaleX: 0.5,
+ scaleY: 4
+ }, {
+ duration: 150,
+ easing: tween.easeOut
+ });
+ }, 150);
+ }
+ // Scale back down after a moment
+ LK.setTimeout(function () {
+ tween(button, {
+ scaleX: 1,
+ scaleY: 1,
+ rotation: 0,
+ x: 2048 / 2,
+ y: 2732 / 2 - 100
+ }, {
+ duration: 300,
+ easing: tween.easeOut
+ });
+ }, 300);
+ // Change button text to random scary message
+ buttonText.setText(randomMessage + ' ' + clickCount + ' CLICKS!');
+}
// Handle button clicks
button.down = function (x, y, obj) {
if (currentTab === 'infinity') {
- clickCount++;
+ var clicksToAdd = tripleClickActive ? 3 : 1;
+ clickCount += clicksToAdd;
storage.clickCount = clickCount;
counterText.setText('Clicks: ' + clickCount);
+ // Award coins every 10 clicks
+ if (clickCount % 10 === 0) {
+ boosterCoins++;
+ storage.boosterCoins = boosterCoins;
+ coinsText.setText('Coins: ' + boosterCoins);
+ }
// Check for jumpscare at every hundred
if (clickCount % 100 === 0) {
- // Array of scary messages
- var scaryMessages = ['BOO!', 'GOTCHA!', 'SURPRISE!', 'SCARED YET?', 'JUMP!', 'AAAHHH!', 'SPOOKY!', 'FEAR ME!'];
- var randomMessage = scaryMessages[Math.floor(Math.random() * scaryMessages.length)];
- // Random jumpscare type (0-3)
- var jumpscareType = Math.floor(Math.random() * 4);
- if (jumpscareType === 0) {
- // Type 1: Red flash with dramatic scale and shake
- LK.effects.flashScreen(0xff0000, 500);
- tween(button, {
- scaleX: 3,
- scaleY: 3
- }, {
- duration: 200,
- easing: tween.bounceOut
- });
- tween(button, {
- x: button.x + Math.random() * 40 - 20,
- y: button.y + Math.random() * 40 - 20
- }, {
- duration: 50
- });
- } else if (jumpscareType === 1) {
- // Type 2: Purple flash with spin and grow
- LK.effects.flashScreen(0x800080, 700);
- tween(button, {
- scaleX: 2.5,
- scaleY: 2.5,
- rotation: Math.PI * 2
- }, {
- duration: 400,
- easing: tween.elasticOut
- });
- } else if (jumpscareType === 2) {
- // Type 3: Orange flash with rapid shake
- LK.effects.flashScreen(0xff4500, 600);
- var shakeCount = 0;
- var shakeInterval = LK.setInterval(function () {
- button.x = 2048 / 2 + Math.random() * 60 - 30;
- button.y = 2732 / 2 - 100 + Math.random() * 60 - 30;
- shakeCount++;
- if (shakeCount >= 10) {
- LK.clearInterval(shakeInterval);
- }
- }, 30);
- } else {
- // Type 4: Green flash with wild scaling
- LK.effects.flashScreen(0x00ff00, 400);
- tween(button, {
- scaleX: 4,
- scaleY: 0.5
- }, {
- duration: 150,
- easing: tween.easeIn
- });
- LK.setTimeout(function () {
- tween(button, {
- scaleX: 0.5,
- scaleY: 4
- }, {
- duration: 150,
- easing: tween.easeOut
- });
- }, 150);
- }
- // Scale back down after a moment
- LK.setTimeout(function () {
- tween(button, {
- scaleX: 1,
- scaleY: 1,
- rotation: 0,
- x: 2048 / 2,
- y: 2732 / 2 - 100
- }, {
- duration: 300,
- easing: tween.easeOut
- });
- }, 300);
- // Change button text to random scary message
- buttonText.setText(randomMessage + ' ' + clickCount + ' CLICKS!');
+ triggerJumpscare();
} else {
// Change button text to random message
buttonText.setText(buttonTexts[Math.floor(Math.random() * buttonTexts.length)]);
}