User prompt
Если выйти из магазина то кнопка магазина вернётся
User prompt
Если покупать двойной клик то у игрока тратиться 500 $
User prompt
С делай кнопку назад отдельной кнопкой
User prompt
При открытии меню появляются кно пки назад при нажатии возрощяет к биткоину покупка клика при нажатии сумма при клике увеличилась на один
User prompt
Добавь кнопку магазина при нажатии открываеться минюшка
User prompt
Сделай образование эффекта при клике
User prompt
Сделай эффект жимания у биткоина при нажатии
User prompt
Please fix the bug: 'Uncaught TypeError: bitcoin.replaceWith is not a function' in or related to this line: 'bitcoin.replaceWith('1', {' Line Number: 38
User prompt
Добавь при нажатии на биткоин он заменялся на другой белее маленький биткоин а потом возрощялься обратно
User prompt
Добавь эффект при нажатии на биткоин он уменьшается а потом возрощялься на обычный размер
User prompt
Добавь счётчик с верху
User prompt
При нажатии на биткоин даётся 1$
User prompt
Создай в центре биткоин
User prompt
Удали игру
User prompt
Migrate to the latest version of LK
Initial prompt
Minecliker
/**** * Classes ****/ // Class for the back button var BackButton = Container.expand(function () { var self = Container.call(this); // Create a back button var backButton = self.attachAsset('backButton', { anchorX: 0.0, anchorY: 0.0, x: 0, y: 0 }); backButton.down = function (x, y, obj) { // Hide the shop menu and the back button, and show the bitcoin and the shop button when the back button is pressed shopMenu.visible = false; bitcoin.visible = true; shopButton.visible = true; backButton.visible = false; }; }); // Class for the shop menu var ShopMenu = Container.expand(function () { var self = Container.call(this); // Create a back button var backButton = self.attachAsset('shopButton', { anchorX: 0.0, anchorY: 0.0, x: 0, y: 0 }); backButton.down = function (x, y, obj) { // Hide the shop menu and show the bitcoin when the back button is pressed self.visible = false; bitcoin.visible = true; }; // Create a buy button var buyButton = self.attachAsset('shopButton', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2 }); buyButton.down = function (x, y, obj) { // Check if the player has enough money to buy the upgrade if (LK.getScore() >= 500) { // Deduct the cost of the upgrade from the player's score LK.setScore(LK.getScore() - 500); // Increase the score per click by 1 when the buy button is pressed scorePerClick += 1; } else { // If the player doesn't have enough money, show a message console.log("You don't have enough money to buy this upgrade!"); } }; }); /**** * Initialize Game ****/ // Class for the mine layer // Global variables var game = new LK.Game({ backgroundColor: 0x000000 }); /**** * Game Code ****/ // Create a bitcoin in the center of the game var bitcoin = LK.getAsset('bitcoin', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2 }); game.addChild(bitcoin); // Create a score counter at the top of the screen var scoreTxt = new Text2('0', { size: 150, fill: "#ffffff" }); scoreTxt.anchor.set(0.5, 0); LK.gui.top.addChild(scoreTxt); // Create a shop button in the top right corner of the game var shopButton = LK.getAsset('shopButton', { anchorX: 1, anchorY: 0, x: 2048, y: 0 }); game.addChild(shopButton); // Create a new instance of the shop menu var shopMenu = game.addChild(new ShopMenu()); // Hide the shop menu initially shopMenu.visible = false; // Create a new instance of the back button var backButton = game.addChild(new BackButton()); // Hide the back button initially backButton.visible = false; shopButton.down = function (x, y, obj) { // Hide the bitcoin and the shop button and show the shop menu and the back button when the shop button is pressed bitcoin.visible = false; shopButton.visible = false; shopMenu.visible = true; backButton.visible = true; }; // Create a new variable for the score per click var scorePerClick = 1; bitcoin.down = function (x, y, obj) { // Increase the score by the score per click LK.setScore(LK.getScore() + scorePerClick); scoreTxt.setText(LK.getScore()); // Temporarily shrink bitcoin on press bitcoin.scaleX = 0.8; bitcoin.scaleY = 0.8; // After 100ms, expand the bitcoin back to its original size LK.setTimeout(function () { bitcoin.scaleX = 1.2; bitcoin.scaleY = 1.2; // After another 100ms, revert the bitcoin back to its normal size LK.setTimeout(function () { bitcoin.scaleX = 1; bitcoin.scaleY = 1; }, 100); }, 100); // Add a visual effect to the bitcoin when clicked var effect = LK.getAsset('1', { anchorX: 0.5, anchorY: 0.5, x: bitcoin.x, y: bitcoin.y }); game.addChild(effect); // Remove the effect after 200ms LK.setTimeout(function () { game.removeChild(effect); }, 200); };
===================================================================
--- original.js
+++ change.js
@@ -11,11 +11,13 @@
x: 0,
y: 0
});
backButton.down = function (x, y, obj) {
- // Hide the shop menu and show the bitcoin when the back button is pressed
+ // Hide the shop menu and the back button, and show the bitcoin and the shop button when the back button is pressed
shopMenu.visible = false;
bitcoin.visible = true;
+ shopButton.visible = true;
+ backButton.visible = false;
};
});
// Class for the shop menu
var ShopMenu = Container.expand(function () {
Пиксельная кнопка где нарисована телега на красном фоне. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Пиксельный биткоин золотой. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Пиксельная кнопка назад красно белая. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Пиксельная кнопка авто клик красно белая. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Сделай пиксельный фон голубой с задним фоном где $ строго размерами 2048 на 2732. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.