User prompt
Now do the same thing eith the greenglowy logic but spply it to the circleglow
User prompt
Delete the animation
User prompt
Found a glitch where when you click the button asset before you equip the greenglowyasset, it wont show the greengloey asset
User prompt
Awesome! But there is a bug where if you click the button and then equip the greenglowy it doesnt show up, please fox this
User prompt
It didnt work
User prompt
Found a glitch where if you equip the greenglowy asset then unequip it and then equip it again it doesnt show up, fix that please
User prompt
Make it so when you equip the greenglowy asset and then click on it again the greenglowy asset in the button gets deleted
User prompt
Choose a different animation where it bouncesut staysi thesame place ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Now add an animation to the button whenever you click it so it bounces up and down ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
And when you buy it, it costs 550$ and every 0.5 seconds it clicks the button for you
User prompt
When the third clicker upgrade is bought add another button in that same size and position but make it the autoclick asset, and the text will say autoclicker 550$
User prompt
Now make it so whe youbuy the third clicker upgrade it gets deleted
User prompt
When you remove the second clicker upgrade add the last clicker upgrade that when you click it, it costs you 500$ and it turns your ppc value equal to 8
User prompt
Make it so whenyou buy the second clicker button the second clicke button gets deleted
User prompt
The third clicker button should cost 500 ad
User prompt
Found a glitch ehere when the third clicker button appears i think it is actually the second clicker button pls fix that it should be the third clicker button
User prompt
When the third clicker upgrade is bought set ppc equal to 8
User prompt
Then when the second clicker upgrade is bought set ppc value equal to 4
User prompt
Then when you buy the first clicker upgrade set ppc equal to 2
User prompt
Ok make a variable named ppc, the ppc variable will determine how much point you get every time you click the button. So rescript the button code to be every time you click the button it increases your points by your ppc value. At the start of the game make ppc equal 1
User prompt
No! When the text says +8 click 500$, when you click it, it charges 500$ and it sets your points per click to 8
User prompt
Found a glitch where when you buy the last clicker upgrade instead of it giving you 8 points per click like its supposed to, it gives you 4, please fix
User prompt
And if it says +8 click 500, it costs 500$ and when you buy it your points per click is set to 8
User prompt
Now make another offer show up after you buy the +120 one, this one will be +8 click 500
User prompt
New glitch where wehn you buy the +120 click upgrade it sets your points per click to 1, it should be 4
/**** * Plugins ****/ var storage = LK.import("@upit/storage.v1", { points: 0, upgrades: { workerValue: 0 }, unlockedSkins: [] }); var tween = LK.import("@upit/tween.v1"); /**** * Initialize Game ****/ //<Write entity 'classes' with empty functions for important behavior here> var game = new LK.Game({ backgroundColor: 0xFFFFFF //Init game with white background }); /**** * Game Code ****/ //<Write imports for supported plugins here> //<Assets used in the game will automatically appear here> function openShopMenu() { // Logic to display the shop menu console.log("Shop menu is now open."); // Create a large shop menu var shopMenu = LK.getAsset('Shop', { width: 1600, // Increase width height: 1600, // Increase height to make it taller x: 2048 / 2 - 800, // Center horizontally y: 2732 / 2 - 800 // Center vertically }); game.addChild(shopMenu); // Add greenglow asset purchase option var greenglowButton = LK.getAsset('Greenglowy', { width: 400, height: 400, x: shopMenu.x + 100, y: shopMenu.y + 100 }); game.addChild(greenglowButton); var greenglowButtonText = new Text2(greenglowyvalue === 2 ? 'Equipped' : greenglowyvalue === 1 ? 'Owned' : '20$ Greenglow', { size: 70, fill: 0x000000 }); greenglowButtonText.x = greenglowButton.x + greenglowButton.width / 2 - greenglowButtonText.width / 2; greenglowButtonText.y = greenglowButton.y + greenglowButton.height / 2 - greenglowButtonText.height / 2 + 250; game.addChild(greenglowButtonText); // Add circle asset purchase option var circleButton = LK.getAsset('Circleglow', { width: 400, height: 400, x: shopMenu.x + 600, // Position next to greenglowButton y: shopMenu.y + 100 }); game.addChild(circleButton); var circleButtonText = new Text2(circlevalue === 2 ? 'Equipped' : circlevalue === 1 ? 'Owned' : '20$ Circle', { size: 70, fill: 0x000000 }); circleButtonText.x = circleButton.x + circleButton.width / 2 - circleButtonText.width / 2; circleButtonText.y = circleButton.y + circleButton.height / 2 - circleButtonText.height / 2 + 250; game.addChild(circleButtonText); greenglowButton.down = function (x, y, obj) { if (greenglowyvalue === 1) { console.log("Greenglowy already owned."); greenglowyvalue = 2; // Set value to 2 if clicked again after purchase greenglowButtonText.setText('Equipped'); // Update text to 'Equipped' } else if (greenglowyvalue === 2) { greenglowyvalue = 1; // Toggle value back to 1 greenglowButtonText.setText('Owned'); // Update text to 'Owned' // Remove Greenglowy asset from button when unequipped if (typeof greenglowOverlay !== 'undefined') { game.removeChild(greenglowOverlay); greenglowOverlay = undefined; // Set greenglowOverlay to undefined } } else if (points >= 20 && greenglowyvalue === 0) { points -= 20; pointsText.setText('Points: ' + points); storage.points = points; storage.unlockedSkins.push('Greenglowy'); greenglowyvalue = 1; // game.removeChild(greenglowButton); greenglowButtonText.setText('Owned'); storage.unlockedSkins.push('Greenglowy'); storage.unlockedSkins.push('Greenglowy'); // Replace the button asset with the greenglow asset points += clickerUpgradePurchased ? 2 : 1; pointsText.setText('Points: ' + points); // Update points text storage.points = points; // Update storage with new points currentButtonSkin = 'Greenglowy'; if (whoequipped === 'Circleglow' && typeof circleglowOverlay !== 'undefined') { game.removeChild(circleglowOverlay); // Remove Circleglow if it was previously equipped } if (greenglowyvalue !== 2 && typeof greenglowOverlay !== 'undefined') { game.removeChild(greenglowOverlay); // Remove Greenglowy if it was previously equipped } whoequipped = 'Greenglowy'; // Update whoequipped to track the equipped skin } // Display the Greenglowy asset on the button only when equipped if (whoequipped === 'Greenglowy' && greenglowyvalue === 2) { if (typeof circleglowOverlay !== 'undefined' && circleglowOverlay) { game.removeChild(circleglowOverlay); } if (typeof greenglowOverlay !== 'undefined') { game.removeChild(greenglowOverlay); // Remove existing overlay if present } greenglowOverlay = LK.getAsset('Greenglowy', { width: newButton.width, height: newButton.height, x: newButton.x, y: newButton.y }); game.addChild(greenglowOverlay); whoequipped = 'Greenglowy'; // Ensure whoequipped is updated to 'Greenglowy' } else { console.log("Not enough points to purchase Greenglow."); } }; circleButton.down = function (x, y, obj) { if (circlevalue === 1) { console.log("Circle already owned."); circlevalue = 2; // Set value to 2 if clicked again after purchase circleButtonText.setText('Equipped'); // Update text to 'Equipped' } else if (circlevalue === 2) { circlevalue = 1; // Toggle value back to 1 circleButtonText.setText('Owned'); // Update text to 'Owned' // Remove Circleglow asset from button when unequipped if (typeof circleglowOverlay !== 'undefined') { game.removeChild(circleglowOverlay); circleglowOverlay = undefined; // Set circleglowOverlay to undefined } } else if (points >= 20 && circlevalue === 0) { points -= 20; pointsText.setText('Points: ' + points); storage.points = points; storage.unlockedSkins.push('Circleglow'); circlevalue = 1; circleButtonText.setText('Owned'); if (whoequipped === 'Greenglowy' && typeof greenglowOverlay !== 'undefined') { game.removeChild(greenglowOverlay); // Remove Greenglowy if it was previously equipped } if (circleglowOverlay) { game.removeChild(circleglowOverlay); // Remove existing overlay if present } circleglowOverlay = LK.getAsset('Circleglow', { width: newButton.width, height: newButton.height, x: newButton.x, y: newButton.y }); game.addChild(circleglowOverlay); whoequipped = 'Circleglow'; // Update whoequipped to track the equipped skin } else { console.log("Not enough points to purchase Circle."); } }; // Add a close button to the shop menu var closeButton = LK.getAsset('Close', { width: 300, height: 300, x: shopMenu.x + shopMenu.width - 610, y: shopMenu.y + 10, shape: 'box' }); game.addChild(closeButton); var closeButtonText = new Text2('Close', { size: 80, fill: 0x000000 }); closeButtonText.x = closeButton.x + closeButton.width / 2 - closeButtonText.width / 2; closeButtonText.y = closeButton.y + closeButton.height / 2 - closeButtonText.height / 2 + 50; game.addChild(closeButtonText); closeButton.down = function (x, y, obj) { game.removeChild(shopMenu); game.removeChild(closeButton); game.removeChild(closeButtonText); game.removeChild(greenglowButton); game.removeChild(greenglowButtonText); game.removeChild(circleButton); // Ensure Circleglow is removed when shop is closed game.removeChild(circleButtonText); // game.removeChild(shadowglowButton); // Removed as shadowglowButton is not defined // game.removeChild(shadowglowButtonText); // Removed as shadowglowButtonText is not defined // Removed glowpack and glowpackText as they are not defined game.removeChild(LK.getAsset('Gloworange', {})); // Ensure Gloworange is removed when shop is closed }; } // Clear the interval when the game is over game.gameOver = function () { clearInterval(intervalId); }; var greenglowyvalue = 0; var circlevalue = 0; // Initialize circlevalue var ppc = 1; // Initialize points per click to 1 var points = storage.points || 0; var currentButtonSkin = null; // Variable to track the current button skin obtained from the glow pack var whoequipped = null; // Variable to track which button skin is equipped var clickerUpgradePurchased = false; // Track if Clicker Upgrade is purchased var workerValue = storage.upgrades.workerValue || 0; // Create a text var pointsText = new Text2('Points: ' + points, { size: 100, fill: 0x000000 }); // Position the text on the left hand corner pointsText.x = 0; pointsText.y = 0; // Add the text to the game game.addChild(pointsText); var newButton = LK.getAsset(currentButtonSkin || 'Button', { width: 400, height: 400, x: 2048 / 2 - 200, // Position the new button in the center of the screen y: 2732 / 2 - 200, shape: 'circle' }); // Add the new button to the game game.addChild(newButton); // Add a click event to the button newButton.down = function (x, y, obj) { // Increase the points points += ppc; // Increase points by ppc value pointsText.setText('Points: ' + points); storage.points = points; if (currentButtonSkin === 'Shadowglowy') { // Additional logic if needed when shadowglow is active } if (LK.getSound('clickSound')) { LK.getSound('clickSound').play(); } else { console.error("Click sound not found!"); } if (whoequipped === 'Circleglow' && circlevalue === 1) { if (greenglowOverlay) { game.removeChild(greenglowOverlay); } var circleglowOverlay = LK.getAsset('Circleglow', { width: newButton.width, height: newButton.height, x: newButton.x, y: newButton.y }); game.addChild(circleglowOverlay); } else if (whoequipped === 'Greenglowy' && greenglowyvalue === 2) { if (circleglowOverlay) { game.removeChild(circleglowOverlay); } if (greenglowOverlay) { game.removeChild(greenglowOverlay); } greenglowOverlay = LK.getAsset('Greenglowy', { width: newButton.width, height: newButton.height, x: newButton.x, y: newButton.y }); game.addChild(greenglowOverlay); whoequipped = 'Greenglowy'; // Ensure whoequipped is updated to 'Greenglowy' } else if (whoequipped === 'Greenglowy' && greenglowyvalue === 1) { if (greenglowOverlay) { game.removeChild(greenglowOverlay); } whoequipped = 'Button'; // Update whoequipped to reflect no skin equipped } else if (whoequipped === 'Button' && greenglowyvalue === 2) { greenglowOverlay = LK.getAsset('Greenglowy', { width: newButton.width, height: newButton.height, x: newButton.x, y: newButton.y }); game.addChild(greenglowOverlay); whoequipped = 'Greenglowy'; } else if (whoequipped === 'Button') { if (circleglowOverlay) { game.removeChild(circleglowOverlay); } if (greenglowOverlay) { game.removeChild(greenglowOverlay); } var buttonOverlay = LK.getAsset('Button', { width: newButton.width, height: newButton.height, x: newButton.x, y: newButton.y }); game.addChild(buttonOverlay); } // Update the text pointsText.setText('Points: ' + points); storage.points = points; }; var shopButton = LK.getAsset('Shop', { width: 400, height: 200, x: 2048 - 400, // Position the button on the bottom right corner y: 2732 - 200 }); game.addChild(shopButton); var shopButtonText = new Text2('Shop', { size: 70, fill: 0x000000 }); shopButtonText.x = shopButton.x + shopButton.width / 2 - shopButtonText.width / 2; shopButtonText.y = shopButton.y + shopButton.height / 2 - shopButtonText.height / 2; game.addChild(shopButtonText); shopButton.down = function (x, y, obj) { // Logic to open the shop menu openShopMenu(); }; // Add an inventory button to the bottom left corner var clickerUpgradeButton = LK.getAsset('Clickupgrade', { width: 600, // Same width as worker upgrade button height: 300, // Same height as worker upgrade button x: 1448, // Align with the worker upgrade button horizontally y: 310 // Position below the worker upgrade button }); game.addChild(clickerUpgradeButton); var clickerUpgradeText = new Text2('+2 click 40$', { size: 100, fill: 0x808080 }); clickerUpgradeText.x = clickerUpgradeButton.x + clickerUpgradeButton.width / 2 - clickerUpgradeText.width / 2; clickerUpgradeText.y = clickerUpgradeButton.y + clickerUpgradeButton.height / 2 - clickerUpgradeText.height / 2; game.addChild(clickerUpgradeText); clickerUpgradeButton.down = function (x, y, obj) { // Logic for clicker upgrade if (points >= 40 && !clickerUpgradePurchased) { points -= 40; pointsText.setText('Points: ' + points); storage.points = points; clickerUpgradePurchased = true; ppc = 2; // Set points per click to 2 after purchasing the first clicker upgrade clickerUpgradeText.setText('+4 click 120$'); // Update text to '+4 click 120$' console.log("Clicker Upgrade to +2 purchased."); } else if (points >= 120 && clickerUpgradePurchased) { points -= 120; pointsText.setText('Points: ' + points); storage.points = points; ppc = 4; // Set points per click to 4 after purchasing the second clicker upgrade clickerUpgradeText.setText('+8 click 500$'); // Update text to '+8 click 500$' console.log("Clicker Upgrade to +4 purchased."); game.removeChild(clickerUpgradeButton); // Remove the second clicker upgrade button // Add the last clicker upgrade button var lastClickerUpgradeButton = LK.getAsset('Clickupgrade', { width: 600, height: 300, x: 1448, y: 310 }); game.addChild(lastClickerUpgradeButton); var lastClickerUpgradeText = new Text2('+8 click 500$', { size: 100, fill: 0x808080 }); lastClickerUpgradeText.x = lastClickerUpgradeButton.x + lastClickerUpgradeButton.width / 2 - lastClickerUpgradeText.width / 2; lastClickerUpgradeText.y = lastClickerUpgradeButton.y + lastClickerUpgradeButton.height / 2 - lastClickerUpgradeText.height / 2; game.addChild(lastClickerUpgradeText); lastClickerUpgradeButton.down = function (x, y, obj) { if (points >= 500) { points -= 500; pointsText.setText('Points: ' + points); storage.points = points; ppc = 8; // Set points per click to 8 after purchasing the last clicker upgrade lastClickerUpgradeText.setText('Max Upgrade'); // Indicate max upgrade reached console.log("Last Clicker Upgrade to +8 purchased."); game.removeChild(lastClickerUpgradeButton); // Remove the third clicker upgrade button game.removeChild(lastClickerUpgradeText); // Remove the text associated with the third clicker upgrade button // Add autoclicker button var autoclickerButton = LK.getAsset('Autoclick', { width: 600, height: 300, x: 1448, y: 310 }); game.addChild(autoclickerButton); var autoclickerText = new Text2('Autoclicker 550$', { size: 100, fill: 0x808080 }); autoclickerText.x = autoclickerButton.x + autoclickerButton.width / 2 - autoclickerText.width / 2; autoclickerText.y = autoclickerButton.y + autoclickerButton.height / 2 - autoclickerText.height / 2; game.addChild(autoclickerText); autoclickerButton.down = function (x, y, obj) { if (points >= 550) { points -= 550; pointsText.setText('Points: ' + points); storage.points = points; console.log("Autoclicker purchased."); // Implement autoclicker functionality intervalId = LK.setInterval(function () { newButton.down(); // Simulate button click }, 500); // Click every 0.5 seconds } else { console.log("Not enough points for Autoclicker."); } }; } else { console.log("Not enough points for Last Clicker Upgrade."); } }; } else if (points >= 500 && clickerUpgradePurchased === true && ppc === 4) { points -= 500; pointsText.setText('Points: ' + points); storage.points = points; ppc = 8; // Set points per click to 8 after purchasing the third clicker upgrade clickerUpgradeText.setText('Max Upgrade'); // Indicate max upgrade reached console.log("Clicker Upgrade to +8 purchased."); } else { console.log("Not enough points for Clicker Upgrade."); } }; var intervalId; var button = LK.getAsset('Shop', { width: 600, height: 300, x: 1448, // Position the button on the right hand corner y: 0 }); // Add the button to the game game.addChild(button); // Add a click event to the button button.down = function (x, y, obj) { // Check if the points are 20 or more if (points >= 20) { // Decrease the points points -= 20; // Update the text pointsText.setText('Points: ' + points); storage.points = points; // Update workerValue to 1 workerValue = 1; storage.upgrades.workerValue = workerValue; storage.upgrades = { workerValue: workerValue }; // Start getting workerValue points every second intervalId = LK.setInterval(function () { points += workerValue; // Update the text pointsText.setText('Points: ' + points); }, 1000); // Remove the old button and its text button.alpha = 0; // Make the original button invisible instead of removing it game.removeChild(buttonText); // Remove the old text // Create a new button with different text var newButton = LK.getAsset('Shop', { width: 600, height: 300, x: 1448, y: 0 }); // Add the new button to the game game.addChild(newButton); // Create a new text var newText = new Text2('50$ +5 worker', { size: 100, fill: 0x000000 }); // Position the text on the new button newText.x = newButton.x + newButton.width / 2 - newText.width / 2; newText.y = newButton.y + newButton.height / 2 - newText.height / 2; // Add the text to the game game.addChild(newText); // Add a click event to the new button newButton.down = function (x, y, obj) { // Check if the points are 50 or more if (points >= 50) { // Decrease the points points -= 50; // Update the text pointsText.setText('Points: ' + points); storage.points = points; // Update workerValue to 5 workerValue = 5; storage.upgrades.workerValue = workerValue; storage.upgrades = { workerValue: workerValue }; // Clear the previous interval LK.clearInterval(intervalId); // Start getting workerValue points every second intervalId = LK.setInterval(function () { points += workerValue; // Update the text pointsText.setText('Points: ' + points); }, 1000); // Remove the old button game.removeChild(newButton); // Create a new button with different text var newButton2 = LK.getAsset('Shop', { width: 600, height: 300, x: 1448, y: 0 }); // Add the new button to the game game.addChild(newButton2); // Create a new text var newText2 = new Text2('150$ +10 worker', { size: 100, fill: 0x000000 }); // Position the text on the new button newText2.x = newButton2.x + newButton2.width / 2 - newText2.width / 2; newText2.y = newButton2.y + newButton2.height / 2 - newText2.height / 2; // Add the text to the game game.addChild(newText2); // Add a click event to the new button newButton2.down = function (x, y, obj) { // Check if the points are 150 or more if (points >= 150 && workerValue === 5) { // Decrease the points points -= 150; // Update the text pointsText.setText('Points: ' + points); storage.points = points; // Update workerValue to 10 workerValue = 10; storage.upgrades.workerValue = workerValue; storage.upgrades = { workerValue: workerValue }; // Clear the previous interval LK.clearInterval(intervalId); // Start getting workerValue points every second intervalId = LK.setInterval(function () { points += workerValue; // Update the text pointsText.setText('Points: ' + points); }, 1000); // Remove the button and all worker texts after purchasing the upgrade game.removeChild(newButton2); game.removeChild(newText2); game.removeChild(button); game.removeChild(buttonText); game.removeChild(newText); // Display 'Worker max: 10/s' text var maxWorkerText = new Text2('Worker max: 10/s', { size: 100, fill: 0x000000 }); maxWorkerText.x = button.x + button.width / 2 - maxWorkerText.width / 2; maxWorkerText.y = button.y + button.height / 2 - maxWorkerText.height / 2; game.addChild(maxWorkerText); } }; } }; } }; // Create a text var buttonText = new Text2('20$ +1 worker', { size: 120, fill: 0x000000 }); // Position the text on the button buttonText.x = button.x + button.width / 2 - buttonText.width / 2; buttonText.y = button.y + button.height / 2 - buttonText.height / 2; // Add the text to the game game.addChild(buttonText); ; whoequipped = 'Circleglow'; // Update whoequipped to track the equipped skin
===================================================================
--- original.js
+++ change.js
@@ -132,30 +132,33 @@
circleButtonText.setText('Equipped'); // Update text to 'Equipped'
} else if (circlevalue === 2) {
circlevalue = 1; // Toggle value back to 1
circleButtonText.setText('Owned'); // Update text to 'Owned'
+ // Remove Circleglow asset from button when unequipped
+ if (typeof circleglowOverlay !== 'undefined') {
+ game.removeChild(circleglowOverlay);
+ circleglowOverlay = undefined; // Set circleglowOverlay to undefined
+ }
} else if (points >= 20 && circlevalue === 0) {
points -= 20;
pointsText.setText('Points: ' + points);
storage.points = points;
storage.unlockedSkins.push('Circleglow');
circlevalue = 1;
- game.removeChild(circleButton);
circleButtonText.setText('Owned');
- // Overlay the Circleglow asset over the existing button
- var circleglowOverlay = LK.getAsset('Circleglow', {
+ if (whoequipped === 'Greenglowy' && typeof greenglowOverlay !== 'undefined') {
+ game.removeChild(greenglowOverlay); // Remove Greenglowy if it was previously equipped
+ }
+ if (circleglowOverlay) {
+ game.removeChild(circleglowOverlay); // Remove existing overlay if present
+ }
+ circleglowOverlay = LK.getAsset('Circleglow', {
width: newButton.width,
height: newButton.height,
x: newButton.x,
y: newButton.y
});
game.addChild(circleglowOverlay);
- if (whoequipped === 'Greenglowy' && typeof greenglowOverlay !== 'undefined') {
- game.removeChild(greenglowOverlay); // Remove Greenglowy if it was previously equipped
- }
- if (whoequipped === 'Circleglow' && typeof circleglowOverlay !== 'undefined') {
- game.removeChild(circleglowOverlay); // Remove Circleglow if it was previously equipped
- }
whoequipped = 'Circleglow'; // Update whoequipped to track the equipped skin
} else {
console.log("Not enough points to purchase Circle.");
}