User prompt
Whrn you ascend you get score multiplier based on *score÷100000*
User prompt
Make points=score
User prompt
Make ascend clickable when score is over 100000
User prompt
Write in ascend how much multiplier you are currently going to get
User prompt
Make ascend give multiplier based on (current score:100000) when clicked
User prompt
Make ascend clickable
User prompt
Make ascend give you multiplier based on (your score:100000)
User prompt
Move ascend down much
User prompt
Move ascend down
User prompt
Move ascend down
User prompt
Move ascend down
User prompt
Move ascend down
User prompt
Move ascend down
User prompt
Move ascend under the button
User prompt
Put ascend under the button
User prompt
Make upgrade5 give +300 points for clicking the button
User prompt
Make upgrade5 cost 100000
User prompt
Add upgrade5 next to upgrade4
User prompt
Make the button have a small animation when clicked ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Make upgrade4 give +100 points for clicking the button
User prompt
Make upgrade4 cost 25000
User prompt
Make upgrade4 cost 15000
User prompt
Please fix the bug: 'Upgrade4 is not defined' in or related to this line: 'var upgrade4 = game.addChild(new Upgrade4());' Line Number: 154
User prompt
Put upgrade4 next to upgrade3
User prompt
Make upgrade3 give +25 points for clicking the button
/**** * Classes ****/ //<Assets used in the game will automatically appear here> //<Write imports for supported plugins here> // Define a ClickableCircle class var ClickableCircle = Container.expand(function () { var self = Container.call(this); self.coinsPerClick = 1; // Create and attach a circle asset var circleGraphics = self.attachAsset('circle', { anchorX: 0.5, anchorY: 0.5 }); // Event handler for when the circle is clicked self.down = function (x, y, obj) { // Increase score by coinsPerClick when the circle is clicked LK.setScore(LK.getScore() + self.coinsPerClick); scoreTxt.setText(LK.getScore()); }; }); var Upgrade = Container.expand(function () { var self = Container.call(this); self.cost = 20; // Create and attach an upgrade asset var upgradeGraphics = self.attachAsset('Upgrade', { anchorX: 0.5, anchorY: 0.5 }); // Add cost text to the upgrade button var costTxt = new Text2(self.cost.toString(), { size: 100, fill: 0x000000 }); costTxt.anchor.set(0.5, 0.5); self.addChild(costTxt); // Event handler for when the upgrade is clicked self.down = function (x, y, obj) { // Check if the player has enough points to purchase the upgrade if (LK.getScore() >= self.cost) { // Deduct the cost of the upgrade from the score LK.setScore(LK.getScore() - self.cost); scoreTxt.setText(LK.getScore()); // Increase coins per click by 1 when the upgrade is clicked circle.coinsPerClick += 1; // Update the cost text costTxt.setText(self.cost.toString()); } }; }); var Upgrade2 = Container.expand(function () { var self = Container.call(this); self.cost = 200; // Create and attach an upgrade2 asset var upgrade2Graphics = self.attachAsset('Upgrade2', { anchorX: 0.5, anchorY: 0.5 }); // Add cost text to the upgrade2 button var costTxt = new Text2(self.cost.toString(), { size: 100, fill: 0x000000 }); costTxt.anchor.set(0.5, 0.5); self.addChild(costTxt); // Event handler for when the upgrade2 is clicked self.down = function (x, y, obj) { // Check if the player has enough points to purchase the upgrade2 if (LK.getScore() >= self.cost) { // Deduct the cost of the upgrade2 from the score LK.setScore(LK.getScore() - self.cost); scoreTxt.setText(LK.getScore()); // Increase coins per click by 5 when the upgrade2 is clicked circle.coinsPerClick += 5; // Update the cost text costTxt.setText(self.cost.toString()); } }; }); var Upgrade3 = Container.expand(function () { var self = Container.call(this); self.cost = 2500; // Create and attach an upgrade3 asset var upgrade3Graphics = self.attachAsset('Upgrade3', { anchorX: 0.5, anchorY: 0.5 }); // Add cost text to the upgrade3 button var costTxt = new Text2(self.cost.toString(), { size: 100, fill: 0x000000 }); costTxt.anchor.set(0.5, 0.5); self.addChild(costTxt); // Event handler for when the upgrade3 is clicked self.down = function (x, y, obj) { // Check if the player has enough points to purchase the upgrade3 if (LK.getScore() >= self.cost) { // Deduct the cost of the upgrade3 from the score LK.setScore(LK.getScore() - self.cost); scoreTxt.setText(LK.getScore()); // Increase coins per click by 25 when the upgrade3 is clicked circle.coinsPerClick += 25; // Update the cost text costTxt.setText(self.cost.toString()); } }; }); var Upgrade4 = Container.expand(function () { var self = Container.call(this); self.cost = 25000; // Create and attach an upgrade4 asset var upgrade4Graphics = self.attachAsset('Upgrade4', { anchorX: 0.5, anchorY: 0.5 }); // Add cost text to the upgrade4 button var costTxt = new Text2(self.cost.toString(), { size: 100, fill: 0x000000 }); costTxt.anchor.set(0.5, 0.5); self.addChild(costTxt); // Event handler for when the upgrade4 is clicked self.down = function (x, y, obj) { // Check if the player has enough points to purchase the upgrade4 if (LK.getScore() >= self.cost) { // Deduct the cost of the upgrade4 from the score LK.setScore(LK.getScore() - self.cost); scoreTxt.setText(LK.getScore()); // Increase coins per click by 50 when the upgrade4 is clicked circle.coinsPerClick += 50; // Update the cost text costTxt.setText(self.cost.toString()); } }; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 //Init game with black background }); /**** * Game Code ****/ // Initialize score text var scoreTxt = new Text2('0', { size: 150, fill: 0xFFFFFF }); scoreTxt.anchor.set(0.5, 0); LK.gui.top.addChild(scoreTxt); // Create a clickable circle and add it to the game var circle = game.addChild(new ClickableCircle()); circle.x = 2048 / 2; circle.y = 2732 / 2; // Create an upgrade and add it to the game var upgrade = game.addChild(new Upgrade()); upgrade.x = 2048 / 2 - 700; upgrade.y = 2732 / 3; // Create an upgrade2 and add it to the game var upgrade2 = game.addChild(new Upgrade2()); upgrade2.x = upgrade.x + upgrade.width + 50; upgrade2.y = upgrade.y; // Update function called every game tick // Create an upgrade3 and add it to the game var upgrade3 = game.addChild(new Upgrade3()); upgrade3.x = upgrade2.x + upgrade2.width + 50; upgrade3.y = upgrade2.y; // Create an upgrade4 and add it to the game var upgrade4 = game.addChild(new Upgrade4()); upgrade4.x = upgrade3.x + upgrade3.width + 50; upgrade4.y = upgrade3.y; game.update = function () { // Game logic can be added here if needed };
===================================================================
--- original.js
+++ change.js
@@ -107,9 +107,9 @@
};
});
var Upgrade4 = Container.expand(function () {
var self = Container.call(this);
- self.cost = 15000;
+ self.cost = 25000;
// Create and attach an upgrade4 asset
var upgrade4Graphics = self.attachAsset('Upgrade4', {
anchorX: 0.5,
anchorY: 0.5