Code edit (1 edits merged)
Please save this source code
User prompt
haz los botones de mejoras un poco mas altos y un poco mas separados
User prompt
quita el ultimo cambio que te dije
User prompt
haz que el boton de autoclick de 2$ por segundo no 1$
User prompt
el boton de autoclick haz que de 2 por segundo
User prompt
cambia el color de los numeros que salen al hacer click al color blanco
User prompt
quitame el simbolo del dolar que hay en el boton de clicks
User prompt
quitame el simbolo del dolar que hay encima de la moneda
User prompt
quta la confirmacion del boton de reiniciar
User prompt
el boton de confirmar sale arriba a la izquierda y tiene que estar al medeio de la pantalla
User prompt
hay un error en el boton
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'shape')' in or related to this line: 'var dialogGraphics = self.addChild(new LK.init.shape('resetButton', {' Line Number: 23
User prompt
quando pulses el boton de reiniciar que te salga una ventana que diga "estas seguro" y un boton abajo rojo
User prompt
haz un boton abajo a la derecha de reiniciar el nivel "reiniciar" y que si pulsas te reinicie el dinero y todas las compras
User prompt
puedes ordenar las compras de mas barata arriba a la mas cara abajo
User prompt
ahora pon un simblolo de dolar al num de quando haces click
User prompt
que en las particulas quando das clic solo salga en numero de monedas que haces por click, quita el quadrado amarillo
User prompt
cuando haces click las particulas que salen que sean monedas y que pongan el numendo de monedas que me da por click
Code edit (1 edits merged)
Please save this source code
User prompt
Money Clicker Tycoon
Initial prompt
quiero un juego clicker donde en la parete de la derecha habra mejoras como x2 de dinero etc.
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
var storage = LK.import("@upit/storage.v1");
/****
* Classes
****/
var BonusCoin = Container.expand(function () {
var self = Container.call(this);
var coinGraphics = self.attachAsset('bonusCoin', {
anchorX: 0.5,
anchorY: 0.5
});
// Removed the '2X' text from the bonus coin
// Pulsing animation
self.pulseTimer = 0;
self.update = function () {
self.pulseTimer++;
var scale = 1 + Math.sin(self.pulseTimer * 0.1) * 0.2;
coinGraphics.scaleX = scale;
coinGraphics.scaleY = scale;
};
self.down = function (x, y, obj) {
// Prevent clicking when dialog is open
if (isDialogOpen) {
return;
}
// Play coin click sound
LK.getSound('coinClick').play();
// Activate 2x multiplier
isDoubleClickActive = true;
doubleClickTimer = 3600; // 60 seconds * 60 FPS
lastBonusCoinTime = Date.now();
storage.lastBonusCoinTime = lastBonusCoinTime;
storage.isDoubleClickActive = isDoubleClickActive;
storage.doubleClickTimer = doubleClickTimer;
// Visual feedback
tween(self, {
scaleX: 0,
scaleY: 0,
alpha: 0
}, {
duration: 300,
onFinish: function onFinish() {
self.destroy();
}
});
// Reset bonus coin availability
bonusCoin = null;
};
return self;
});
var ConfirmDialog = Container.expand(function () {
var self = Container.call(this);
var confirmText = self.addChild(new Text2('⚠️ ¿Estás seguro?', {
size: 50,
fill: 0x000000
}));
confirmText.anchor.set(0.5, 0.5);
confirmText.y = -30;
var buttonBackground = self.attachAsset('resetButton', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 1.21
});
buttonBackground.y = 100;
var buttonText = self.addChild(new Text2('✅ CONFIRMAR', {
size: 40,
fill: 0x000000
}));
buttonText.anchor.set(0.5, 0.5);
buttonText.y = 100;
// Add back button
var backButtonBackground = self.attachAsset('resetButton', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 1.0
});
backButtonBackground.y = 250;
var backButtonText = self.addChild(new Text2('← VOLVER', {
size: 40,
fill: 0x000000
}));
backButtonText.anchor.set(0.5, 0.5);
backButtonText.y = 250;
buttonBackground.down = function (x, y, obj) {
if (self.onConfirm) {
self.onConfirm();
}
darkOverlay.destroy(); // Remove the dark overlay when confirmed
isDialogOpen = false; // Reset dialog state
self.destroy();
};
buttonText.down = function (x, y, obj) {
if (self.onConfirm) {
self.onConfirm();
}
darkOverlay.destroy(); // Remove the dark overlay when confirmed
isDialogOpen = false; // Reset dialog state
self.destroy();
};
backButtonBackground.down = function (x, y, obj) {
darkOverlay.destroy(); // Remove the dark overlay when going back
isDialogOpen = false; // Reset dialog state
self.destroy();
};
backButtonText.down = function (x, y, obj) {
darkOverlay.destroy(); // Remove the dark overlay when going back
isDialogOpen = false; // Reset dialog state
self.destroy();
};
return self;
});
var MoneyButton = Container.expand(function () {
var self = Container.call(this);
var buttonGraphics = self.attachAsset('moneyButton', {
anchorX: 0.5,
anchorY: 0.5
});
var moneyText = self.addChild(new Text2('', {
size: 200,
fill: 0x000000
}));
moneyText.anchor.set(0.5, 0.5);
self.down = function (x, y, obj) {
// Prevent clicking when dialog is open
if (isDialogOpen) {
return;
}
tween(buttonGraphics, {
scaleX: 0.9,
scaleY: 0.9
}, {
duration: 50
});
LK.getSound('coinClick').play();
var earned = moneyPerClick;
if (isDoubleClickActive) {
earned *= 2;
}
money += earned;
updateMoneyDisplay();
var particle = new MoneyParticle();
particle.setValue(earned);
particle.x = self.x + (Math.random() - 0.5) * 200;
particle.y = self.y - 100;
game.addChild(particle);
moneyParticles.push(particle);
};
self.up = function (x, y, obj) {
tween(buttonGraphics, {
scaleX: 1,
scaleY: 1
}, {
duration: 100
});
};
return self;
});
var MoneyParticle = Container.expand(function () {
var self = Container.call(this);
// Removed the yellow square asset to display only the number of coins earned per click
var particleText = self.addChild(new Text2('+$0', {
size: 60,
fill: 0x000000
}));
particleText.anchor.set(0.5, 0.5);
self.lifetime = 60;
self.velocityY = -8;
self.setValue = function (value) {
particleText.setText('$' + formatNumber(value)); // Display the number of coins earned per click with a dollar symbol
};
self.update = function () {
self.y += self.velocityY;
self.velocityY += 0.3;
self.lifetime--;
self.alpha = self.lifetime / 60;
if (self.lifetime <= 0) {
self.shouldDestroy = true;
}
};
return self;
});
var MuteButton = Container.expand(function () {
var self = Container.call(this);
var buttonGraphics = self.attachAsset('muteButton', {
anchorX: 0.5,
anchorY: 0.5
});
var muteText = self.addChild(new Text2('♪', {
size: 60,
fill: 0x000000
}));
muteText.anchor.set(0.5, 0.5);
self.isMuted = storage.isMuted || false;
self.updateDisplay = function () {
if (self.isMuted) {
muteText.setText('♪');
buttonGraphics.tint = 0x666666;
} else {
muteText.setText('♪');
buttonGraphics.tint = 0x4CAF50;
}
};
self.down = function (x, y, obj) {
// Prevent clicking when dialog is open
if (isDialogOpen) {
return;
}
self.isMuted = !self.isMuted;
if (self.isMuted) {
LK.stopMusic();
} else {
LK.playMusic('backgroundMusic');
}
self.updateDisplay();
storage.isMuted = self.isMuted;
};
self.updateDisplay();
return self;
});
var ResetButton = Container.expand(function () {
var self = Container.call(this);
var buttonGraphics = self.attachAsset('resetButton', {
anchorX: 0.5,
anchorY: 0.5
});
var resetText = self.addChild(new Text2('🔄 REINICIAR', {
size: 40,
fill: 0x000000
}));
resetText.anchor.set(0.5, 0.5);
self.down = function (x, y, obj) {
// Prevent multiple dialogs from opening
if (isDialogOpen) {
return;
}
isDialogOpen = true;
// Darken the background
darkOverlay = LK.getAsset('pixelBlock1', {
width: 2048,
height: 2732,
alpha: 0.5,
interactive: true
});
game.addChild(darkOverlay);
var confirmDialog = new ConfirmDialog();
game.addChild(confirmDialog);
confirmDialog.x = 2048 / 2;
confirmDialog.y = 2732 / 2;
confirmDialog.onConfirm = function () {
darkOverlay.destroy(); // Remove the dark overlay when confirmed
// Reset money and purchases
money = 0;
moneyPerClick = 1;
autoClickerRate = 0;
for (var i = 0; i < upgradeButtons.length; i++) {
upgradeButtons[i].purchased = false;
upgradeButtons[i].updateDisplay();
if (upgradeButtons[i].upgradeType === 'click2x') {
upgradeButtons[i].getChildAt(1).setText('+2 Click Power');
} else if (upgradeButtons[i].upgradeType === 'click8x') {
upgradeButtons[i].getChildAt(1).setText('+8 Click Power');
} else if (upgradeButtons[i].upgradeType === 'click5x') {
upgradeButtons[i].getChildAt(1).setText('+5 Click Power');
} else if (upgradeButtons[i].upgradeType === 'click10x') {
upgradeButtons[i].getChildAt(1).setText('+10 Click Power');
} else if (upgradeButtons[i].upgradeType === 'click50x') {
upgradeButtons[i].getChildAt(1).setText('+50 Click Power');
} else if (upgradeButtons[i].upgradeType === 'click200x') {
upgradeButtons[i].getChildAt(1).setText('+200 Click Power');
} else if (upgradeButtons[i].upgradeType === 'click500x') {
upgradeButtons[i].getChildAt(1).setText('+500 Click Power');
} else if (upgradeButtons[i].upgradeType === 'auto1') {
upgradeButtons[i].getChildAt(1).setText('Auto Clicker');
} else if (upgradeButtons[i].upgradeType === 'auto2') {
upgradeButtons[i].getChildAt(1).setText('Super Auto');
}
upgradeButtons[i].getChildAt(2).setText('$' + formatNumber(upgradeButtons[i].cost)); // Reset the cost text
}
// Reset upgrades
for (var i = 0; i < upgradeData.length; i++) {
upgradeData[i].cost = upgradeData[i].cost; // Reset cost to initial value
upgradeData[i].multiplier = upgradeData[i].multiplier; // Reset multiplier to initial value
}
updateMoneyDisplay();
saveGame();
};
confirmDialog.onConfirm = function () {
// Reset money and purchases
money = 0;
moneyPerClick = 1;
autoClickerRate = 0;
// Reset bonus coin timer
lastBonusCoinTime = 0;
isDoubleClickActive = false;
doubleClickTimer = 0;
if (bonusCoin) {
bonusCoin.destroy();
bonusCoin = null;
}
for (var i = 0; i < upgradeButtons.length; i++) {
upgradeButtons[i].purchased = false;
upgradeButtons[i].updateDisplay();
if (upgradeButtons[i].upgradeType === 'click2x') {
upgradeButtons[i].getChildAt(1).setText('2 Click Power');
} else if (upgradeButtons[i].upgradeType === 'click8x') {
upgradeButtons[i].getChildAt(1).setText('10 Click Power');
} else if (upgradeButtons[i].upgradeType === 'click5x') {
upgradeButtons[i].getChildAt(1).setText('5 Click Power');
} else if (upgradeButtons[i].upgradeType === 'click10x') {
upgradeButtons[i].getChildAt(1).setText('10 Click Power');
} else if (upgradeButtons[i].upgradeType === 'click50x') {
upgradeButtons[i].getChildAt(1).setText('50 Click Power');
} else if (upgradeButtons[i].upgradeType === 'click200x') {
upgradeButtons[i].getChildAt(1).setText('200 Click Power');
} else if (upgradeButtons[i].upgradeType === 'click500x') {
upgradeButtons[i].getChildAt(1).setText('500 Click Power');
} else if (upgradeButtons[i].upgradeType === 'auto1') {
upgradeButtons[i].getChildAt(1).setText('Auto Clicker');
} else if (upgradeButtons[i].upgradeType === 'auto2') {
upgradeButtons[i].getChildAt(1).setText('Super Auto');
}
upgradeButtons[i].getChildAt(2).setText('$' + formatNumber(upgradeButtons[i].cost)); // Reset the cost text
}
// Reset upgrades
for (var i = 0; i < upgradeData.length; i++) {
upgradeData[i].cost = upgradeData[i].cost; // Reset cost to initial value
upgradeData[i].multiplier = upgradeData[i].multiplier; // Reset multiplier to initial value
}
updateMoneyDisplay();
saveGame();
};
};
return self;
});
var UpgradeButton = Container.expand(function () {
var self = Container.call(this);
self.upgradeType = '';
self.cost = 0;
self.multiplier = 1;
self.purchased = false;
var buttonGraphics = self.attachAsset('upgradeButton', {
anchorX: 0.5,
anchorY: 0.15,
scaleX: 1.1 // Increase width by 10%
});
var titleText = self.addChild(new Text2('Upgrade', {
size: 40,
fill: 0xffffff
}));
titleText.anchor.set(0.5, 0.5);
titleText.y = 35;
var costText = self.addChild(new Text2('$0', {
size: 40,
fill: 0xffffff
}));
costText.anchor.set(0.5, 0.5);
costText.y = 90;
self.setup = function (type, baseCost, mult) {
self.upgradeType = type;
self.cost = baseCost;
self.multiplier = mult;
if (type === 'click2x') {
titleText.setText('💰 2 Click Power');
} else if (type === 'click8x') {
titleText.setText('🚀 10 Click Power');
} else if (type === 'click5x') {
titleText.setText('⭐ 5 Click Power');
} else if (type === 'click10x') {
titleText.setText('🔥 10 Click Power');
} else if (type === 'click50x') {
titleText.setText('💎 50 Click Power');
} else if (type === 'click200x') {
titleText.setText('👑 200 Click Power');
} else if (type === 'click500x') {
titleText.setText('🌟 500 Click Power');
} else if (type === 'auto1') {
titleText.setText('🤖 Auto Clicker');
} else if (type === 'click1000x') {
titleText.setText('1000 Click Power');
titleText.setText('⚡ 1000 Click Power');
}
self.updateDisplay();
};
self.updateDisplay = function () {
costText.setText('$' + formatNumber(self.cost));
if (money >= self.cost && !self.purchased) {
buttonGraphics.tint = 0xffffff;
} else {
buttonGraphics.tint = 0x666666;
}
};
self.down = function (x, y, obj) {
// Prevent clicking when dialog is open
if (isDialogOpen) {
return;
}
if (money >= self.cost && !self.purchased) {
money -= self.cost;
self.purchased = true;
if (self.upgradeType.startsWith('click')) {
if (self.upgradeType === 'click8x') {
moneyPerClick += 8;
} else if (self.upgradeType === 'click10x') {
moneyPerClick += 10;
} else if (self.upgradeType === 'click50x') {
moneyPerClick += 40;
} else if (self.upgradeType === 'click200x') {
moneyPerClick += 150;
} else if (self.upgradeType === 'click500x') {
moneyPerClick += 300;
} else if (self.upgradeType === 'click1000x') {
moneyPerClick += 1000;
moneyPerClick *= self.multiplier;
}
} else if (self.upgradeType.startsWith('auto')) {
if (self.upgradeType === 'auto1') {
autoClickerRate += 1;
} else if (self.upgradeType === 'auto2') {
autoClickerRate += 5;
}
}
LK.getSound('upgrade').play();
buttonGraphics.tint = 0xffffff;
titleText.setText('✅ COMPRADO');
costText.setText('');
updateMoneyDisplay();
saveGame();
}
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x1a1a1a
});
/****
* Game Code
****/
var darkOverlay; // Define darkOverlay in the global scope
var isDialogOpen = false; // Track if confirmation dialog is open
var money = storage.money || 0;
var moneyPerClick = storage.moneyPerClick || 1;
var autoClickerRate = storage.autoClickerRate || 1;
var autoClickerTimer = 0;
var moneyParticles = [];
var moneyDisplay;
var moneyPerClickDisplay;
var autoIncomeDisplay;
var autoClicksDisplay;
var moneyButton;
var upgradeButtons = [];
var bonusCoin = null;
var lastBonusCoinTime = storage.lastBonusCoinTime || 0;
var isDoubleClickActive = storage.isDoubleClickActive || false;
var doubleClickTimer = storage.doubleClickTimer || 0;
var BONUS_COIN_COOLDOWN = 300000; // 5 minutes in milliseconds
function formatNumber(num) {
if (num >= 1000000000) {
return (num / 1000000000).toFixed(1) + 'B';
} else if (num >= 1000000) {
return (num / 1000000).toFixed(1) + 'M';
} else if (num >= 1000) {
return (num / 1000).toFixed(1) + 'K';
}
return Math.floor(num).toString();
}
function updateMoneyDisplay() {
moneyDisplay.setText('💰 $' + formatNumber(money));
moneyPerClickDisplay.setText('💸 Por Click: $' + formatNumber(moneyPerClick));
for (var i = 0; i < upgradeButtons.length; i++) {
upgradeButtons[i].updateDisplay();
}
}
function saveGame() {
storage.money = money;
storage.moneyPerClick = moneyPerClick;
storage.autoClickerRate = autoClickerRate;
storage.lastBonusCoinTime = lastBonusCoinTime;
storage.isDoubleClickActive = isDoubleClickActive;
storage.doubleClickTimer = doubleClickTimer;
}
// Create animated background with more elements
var backgroundElements = [];
// Add background image
var backgroundImage = game.attachAsset('Background', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 0.128,
scaleY: 0.128
});
backgroundImage.x = 2048 / 2;
backgroundImage.y = 2732 / 2;
// Add a square below the upgrade buttons
var backgroundSquare = game.attachAsset('backgroundSquare', {
anchorX: 0.5,
anchorY: 0.5
});
backgroundSquare.x = 1524;
backgroundSquare.y = 1050; // Move it further down
game.addChild(backgroundSquare);
// Create money display
moneyDisplay = new Text2('💰 $0', {
size: 80,
fill: 0x4CAF50
});
moneyDisplay.anchor.set(0.5, 0);
moneyDisplay.x = 650;
moneyDisplay.y = 150;
game.addChild(moneyDisplay);
// Create money per click display
moneyPerClickDisplay = new Text2('💸 Por Click: $1', {
size: 40,
fill: 0x000000
});
moneyPerClickDisplay.anchor.set(0.5, 0);
moneyPerClickDisplay.x = 650;
moneyPerClickDisplay.y = 250;
game.addChild(moneyPerClickDisplay);
// Create money button
moneyButton = new MoneyButton();
moneyButton.x = 650;
moneyButton.y = 800;
moneyButton.scaleX = 1.6; // Make button 60% larger (20% smaller than previous 100% increase)
moneyButton.scaleY = 1.6; // Make button 60% larger (20% smaller than previous 100% increase)
game.addChild(moneyButton);
// Create upgrade menu title
var upgradeTitle = new Text2('🛒 MEJORAS', {
size: 60,
fill: 0x000000
});
upgradeTitle.anchor.set(0.5, 0);
upgradeTitle.x = 1524;
upgradeTitle.y = 150;
game.addChild(upgradeTitle);
// Create upgrade buttons
var upgradeData = [{
type: 'click2x',
cost: 100,
multiplier: 2
}, {
type: 'click8x',
cost: 500,
multiplier: 8
}, {
type: 'click50x',
cost: 2000,
multiplier: 50
}, {
type: 'click200x',
cost: 10000,
multiplier: 200
}, {
type: 'click500x',
cost: 50000,
multiplier: 500
}, {
type: 'click1000x',
cost: 100000,
multiplier: 1000
}];
for (var i = 0; i < upgradeData.length; i++) {
var upgradeButton = new UpgradeButton();
upgradeButton.setup(upgradeData[i].type, upgradeData[i].cost, upgradeData[i].multiplier);
upgradeButton.x = 1524; // Align with the 'UPGRADES' text
upgradeButton.y = 400 + i * 230; // Move buttons slightly up
upgradeButton.scaleX = 1.0; // Make buttons 50% narrower
game.addChild(upgradeButton);
upgradeButtons.push(upgradeButton);
}
// Update displays
updateMoneyDisplay();
// Create mute button
var muteButton = new MuteButton();
muteButton.x = 150;
muteButton.y = 2600;
game.addChild(muteButton);
// Play background music if not muted
if (!muteButton.isMuted) {
LK.playMusic('backgroundMusic');
}
// Create reset button
var resetButton = new ResetButton();
resetButton.x = 1800;
resetButton.y = 2600;
resetButton.scaleX = 1.0; // Make reset button 120% narrower
game.addChild(resetButton);
// Create timer displays
var bonusTimerDisplay = new Text2('Próxima moneda: 5:00', {
size: 70,
fill: 0xffd700
});
bonusTimerDisplay.anchor.set(0.5, 0);
bonusTimerDisplay.x = 2048 / 2;
bonusTimerDisplay.y = 2580;
game.addChild(bonusTimerDisplay);
var doubleEffectDisplay = new Text2('', {
size: 70,
fill: 0xff4444
});
doubleEffectDisplay.anchor.set(0.5, 0);
doubleEffectDisplay.x = 2048 / 2;
doubleEffectDisplay.y = 2570;
game.addChild(doubleEffectDisplay);
// Game update loop
game.update = function () {
// Auto clicker functionality
if (autoClickerRate > 0) {
autoClickerTimer++;
if (autoClickerTimer >= 12) {
// 60 ticks per second / 5 = 12 ticks for 5 clicks per second
autoClickerTimer = 0;
money += moneyPerClick;
updateMoneyDisplay();
}
}
// Bonus coin timer logic
var currentTime = Date.now();
if (!bonusCoin && !isDoubleClickActive && currentTime - lastBonusCoinTime >= BONUS_COIN_COOLDOWN) {
// Spawn bonus coin at random position avoiding all UI elements
bonusCoin = new BonusCoin();
var attempts = 0;
var validPosition = false;
while (!validPosition && attempts < 50) {
var randomX = 200 + Math.random() * 1648; // Keep within safe bounds
var randomY = 350 + Math.random() * 1900; // Keep within safe bounds
// Check if position is too close to money button (radius check)
var distanceToMoneyButton = Math.sqrt(Math.pow(randomX - moneyButton.x, 2) + Math.pow(randomY - moneyButton.y, 2));
// Check if position is too close to upgrade buttons area (expanded)
var tooCloseToUpgrades = randomX > 1150 && randomX < 1900 && randomY > 150 && randomY < 1400;
// Check if position is too close to bottom buttons (expanded)
var tooCloseToBottomButtons = randomY > 2350;
// Check if position is too close to background square (expanded)
var distanceToBackgroundSquare = Math.sqrt(Math.pow(randomX - backgroundSquare.x, 2) + Math.pow(randomY - backgroundSquare.y, 2));
var tooCloseToBackgroundSquare = distanceToBackgroundSquare < 700; // Increased safe distance
// Check if position is too close to money display area
var tooCloseToMoneyDisplay = randomX > 400 && randomX < 900 && randomY > 100 && randomY < 350;
// Check if position is too close to timer displays at bottom
var tooCloseToTimerDisplays = randomY > 2450;
// Check if position is too close to left/right edges
var tooCloseToEdges = randomX < 150 || randomX > 1900;
// Check if position is too close to any button
var tooCloseToAnyButton = distanceToMoneyButton < 450 || tooCloseToUpgrades || tooCloseToBottomButtons || tooCloseToBackgroundSquare || tooCloseToMoneyDisplay || tooCloseToTimerDisplays || tooCloseToEdges;
if (!tooCloseToAnyButton) {
validPosition = true;
bonusCoin.x = randomX;
bonusCoin.y = randomY;
} else {
attempts++;
}
}
// Fallback position if no valid position found (safe area in middle-left)
if (!validPosition) {
bonusCoin.x = 400;
bonusCoin.y = 1800;
}
game.addChild(bonusCoin);
}
// Handle double click effect countdown
if (isDoubleClickActive) {
doubleClickTimer--;
if (doubleClickTimer <= 0) {
isDoubleClickActive = false;
doubleClickTimer = 0;
lastBonusCoinTime = Date.now(); // Reset timer when effect ends
storage.isDoubleClickActive = false;
storage.doubleClickTimer = 0;
storage.lastBonusCoinTime = lastBonusCoinTime;
}
}
// Update timer displays
if (isDoubleClickActive) {
var remainingSeconds = Math.ceil(doubleClickTimer / 60);
var minutes = Math.floor(remainingSeconds / 60);
var seconds = remainingSeconds % 60;
doubleEffectDisplay.setText('Doble click: ' + minutes + ':' + (seconds < 10 ? '0' : '') + seconds);
bonusTimerDisplay.setText('');
} else {
doubleEffectDisplay.setText('');
var timeRemaining = BONUS_COIN_COOLDOWN - (currentTime - lastBonusCoinTime);
if (timeRemaining > 0) {
var remainingSeconds = Math.ceil(timeRemaining / 1000);
var minutes = Math.floor(remainingSeconds / 60);
var seconds = remainingSeconds % 60;
bonusTimerDisplay.setText('Próxima moneda: ' + minutes + ':' + (seconds < 10 ? '0' : '') + seconds);
} else {
bonusTimerDisplay.setText('¡Moneda disponible!');
}
}
// Update particles
for (var i = moneyParticles.length - 1; i >= 0; i--) {
var particle = moneyParticles[i];
if (particle.shouldDestroy) {
particle.destroy();
moneyParticles.splice(i, 1);
}
}
// Auto save every 5 seconds
if (LK.ticks % 300 === 0) {
saveGame();
}
}; /****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
var storage = LK.import("@upit/storage.v1");
/****
* Classes
****/
var BonusCoin = Container.expand(function () {
var self = Container.call(this);
var coinGraphics = self.attachAsset('bonusCoin', {
anchorX: 0.5,
anchorY: 0.5
});
// Removed the '2X' text from the bonus coin
// Pulsing animation
self.pulseTimer = 0;
self.update = function () {
self.pulseTimer++;
var scale = 1 + Math.sin(self.pulseTimer * 0.1) * 0.2;
coinGraphics.scaleX = scale;
coinGraphics.scaleY = scale;
};
self.down = function (x, y, obj) {
// Prevent clicking when dialog is open
if (isDialogOpen) {
return;
}
// Play coin click sound
LK.getSound('coinClick').play();
// Activate 2x multiplier
isDoubleClickActive = true;
doubleClickTimer = 3600; // 60 seconds * 60 FPS
lastBonusCoinTime = Date.now();
storage.lastBonusCoinTime = lastBonusCoinTime;
storage.isDoubleClickActive = isDoubleClickActive;
storage.doubleClickTimer = doubleClickTimer;
// Visual feedback
tween(self, {
scaleX: 0,
scaleY: 0,
alpha: 0
}, {
duration: 300,
onFinish: function onFinish() {
self.destroy();
}
});
// Reset bonus coin availability
bonusCoin = null;
};
return self;
});
var ConfirmDialog = Container.expand(function () {
var self = Container.call(this);
var confirmText = self.addChild(new Text2('⚠️ ¿Estás seguro?', {
size: 50,
fill: 0x000000
}));
confirmText.anchor.set(0.5, 0.5);
confirmText.y = -30;
var buttonBackground = self.attachAsset('resetButton', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 1.21
});
buttonBackground.y = 100;
var buttonText = self.addChild(new Text2('✅ CONFIRMAR', {
size: 40,
fill: 0x000000
}));
buttonText.anchor.set(0.5, 0.5);
buttonText.y = 100;
// Add back button
var backButtonBackground = self.attachAsset('resetButton', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 1.0
});
backButtonBackground.y = 250;
var backButtonText = self.addChild(new Text2('← VOLVER', {
size: 40,
fill: 0x000000
}));
backButtonText.anchor.set(0.5, 0.5);
backButtonText.y = 250;
buttonBackground.down = function (x, y, obj) {
if (self.onConfirm) {
self.onConfirm();
}
darkOverlay.destroy(); // Remove the dark overlay when confirmed
isDialogOpen = false; // Reset dialog state
self.destroy();
};
buttonText.down = function (x, y, obj) {
if (self.onConfirm) {
self.onConfirm();
}
darkOverlay.destroy(); // Remove the dark overlay when confirmed
isDialogOpen = false; // Reset dialog state
self.destroy();
};
backButtonBackground.down = function (x, y, obj) {
darkOverlay.destroy(); // Remove the dark overlay when going back
isDialogOpen = false; // Reset dialog state
self.destroy();
};
backButtonText.down = function (x, y, obj) {
darkOverlay.destroy(); // Remove the dark overlay when going back
isDialogOpen = false; // Reset dialog state
self.destroy();
};
return self;
});
var MoneyButton = Container.expand(function () {
var self = Container.call(this);
var buttonGraphics = self.attachAsset('moneyButton', {
anchorX: 0.5,
anchorY: 0.5
});
var moneyText = self.addChild(new Text2('', {
size: 200,
fill: 0x000000
}));
moneyText.anchor.set(0.5, 0.5);
self.down = function (x, y, obj) {
// Prevent clicking when dialog is open
if (isDialogOpen) {
return;
}
tween(buttonGraphics, {
scaleX: 0.9,
scaleY: 0.9
}, {
duration: 50
});
LK.getSound('coinClick').play();
var earned = moneyPerClick;
if (isDoubleClickActive) {
earned *= 2;
}
money += earned;
updateMoneyDisplay();
var particle = new MoneyParticle();
particle.setValue(earned);
particle.x = self.x + (Math.random() - 0.5) * 200;
particle.y = self.y - 100;
game.addChild(particle);
moneyParticles.push(particle);
};
self.up = function (x, y, obj) {
tween(buttonGraphics, {
scaleX: 1,
scaleY: 1
}, {
duration: 100
});
};
return self;
});
var MoneyParticle = Container.expand(function () {
var self = Container.call(this);
// Removed the yellow square asset to display only the number of coins earned per click
var particleText = self.addChild(new Text2('+$0', {
size: 60,
fill: 0x000000
}));
particleText.anchor.set(0.5, 0.5);
self.lifetime = 60;
self.velocityY = -8;
self.setValue = function (value) {
particleText.setText('$' + formatNumber(value)); // Display the number of coins earned per click with a dollar symbol
};
self.update = function () {
self.y += self.velocityY;
self.velocityY += 0.3;
self.lifetime--;
self.alpha = self.lifetime / 60;
if (self.lifetime <= 0) {
self.shouldDestroy = true;
}
};
return self;
});
var MuteButton = Container.expand(function () {
var self = Container.call(this);
var buttonGraphics = self.attachAsset('muteButton', {
anchorX: 0.5,
anchorY: 0.5
});
var muteText = self.addChild(new Text2('♪', {
size: 60,
fill: 0x000000
}));
muteText.anchor.set(0.5, 0.5);
self.isMuted = storage.isMuted || false;
self.updateDisplay = function () {
if (self.isMuted) {
muteText.setText('♪');
buttonGraphics.tint = 0x666666;
} else {
muteText.setText('♪');
buttonGraphics.tint = 0x4CAF50;
}
};
self.down = function (x, y, obj) {
// Prevent clicking when dialog is open
if (isDialogOpen) {
return;
}
self.isMuted = !self.isMuted;
if (self.isMuted) {
LK.stopMusic();
} else {
LK.playMusic('backgroundMusic');
}
self.updateDisplay();
storage.isMuted = self.isMuted;
};
self.updateDisplay();
return self;
});
var ResetButton = Container.expand(function () {
var self = Container.call(this);
var buttonGraphics = self.attachAsset('resetButton', {
anchorX: 0.5,
anchorY: 0.5
});
var resetText = self.addChild(new Text2('🔄 REINICIAR', {
size: 40,
fill: 0x000000
}));
resetText.anchor.set(0.5, 0.5);
self.down = function (x, y, obj) {
// Prevent multiple dialogs from opening
if (isDialogOpen) {
return;
}
isDialogOpen = true;
// Darken the background
darkOverlay = LK.getAsset('pixelBlock1', {
width: 2048,
height: 2732,
alpha: 0.5,
interactive: true
});
game.addChild(darkOverlay);
var confirmDialog = new ConfirmDialog();
game.addChild(confirmDialog);
confirmDialog.x = 2048 / 2;
confirmDialog.y = 2732 / 2;
confirmDialog.onConfirm = function () {
darkOverlay.destroy(); // Remove the dark overlay when confirmed
// Reset money and purchases
money = 0;
moneyPerClick = 1;
autoClickerRate = 0;
for (var i = 0; i < upgradeButtons.length; i++) {
upgradeButtons[i].purchased = false;
upgradeButtons[i].updateDisplay();
if (upgradeButtons[i].upgradeType === 'click2x') {
upgradeButtons[i].getChildAt(1).setText('+2 Click Power');
} else if (upgradeButtons[i].upgradeType === 'click8x') {
upgradeButtons[i].getChildAt(1).setText('+8 Click Power');
} else if (upgradeButtons[i].upgradeType === 'click5x') {
upgradeButtons[i].getChildAt(1).setText('+5 Click Power');
} else if (upgradeButtons[i].upgradeType === 'click10x') {
upgradeButtons[i].getChildAt(1).setText('+10 Click Power');
} else if (upgradeButtons[i].upgradeType === 'click50x') {
upgradeButtons[i].getChildAt(1).setText('+50 Click Power');
} else if (upgradeButtons[i].upgradeType === 'click200x') {
upgradeButtons[i].getChildAt(1).setText('+200 Click Power');
} else if (upgradeButtons[i].upgradeType === 'click500x') {
upgradeButtons[i].getChildAt(1).setText('+500 Click Power');
} else if (upgradeButtons[i].upgradeType === 'auto1') {
upgradeButtons[i].getChildAt(1).setText('Auto Clicker');
} else if (upgradeButtons[i].upgradeType === 'auto2') {
upgradeButtons[i].getChildAt(1).setText('Super Auto');
}
upgradeButtons[i].getChildAt(2).setText('$' + formatNumber(upgradeButtons[i].cost)); // Reset the cost text
}
// Reset upgrades
for (var i = 0; i < upgradeData.length; i++) {
upgradeData[i].cost = upgradeData[i].cost; // Reset cost to initial value
upgradeData[i].multiplier = upgradeData[i].multiplier; // Reset multiplier to initial value
}
updateMoneyDisplay();
saveGame();
};
confirmDialog.onConfirm = function () {
// Reset money and purchases
money = 0;
moneyPerClick = 1;
autoClickerRate = 0;
// Reset bonus coin timer
lastBonusCoinTime = 0;
isDoubleClickActive = false;
doubleClickTimer = 0;
if (bonusCoin) {
bonusCoin.destroy();
bonusCoin = null;
}
for (var i = 0; i < upgradeButtons.length; i++) {
upgradeButtons[i].purchased = false;
upgradeButtons[i].updateDisplay();
if (upgradeButtons[i].upgradeType === 'click2x') {
upgradeButtons[i].getChildAt(1).setText('2 Click Power');
} else if (upgradeButtons[i].upgradeType === 'click8x') {
upgradeButtons[i].getChildAt(1).setText('10 Click Power');
} else if (upgradeButtons[i].upgradeType === 'click5x') {
upgradeButtons[i].getChildAt(1).setText('5 Click Power');
} else if (upgradeButtons[i].upgradeType === 'click10x') {
upgradeButtons[i].getChildAt(1).setText('10 Click Power');
} else if (upgradeButtons[i].upgradeType === 'click50x') {
upgradeButtons[i].getChildAt(1).setText('50 Click Power');
} else if (upgradeButtons[i].upgradeType === 'click200x') {
upgradeButtons[i].getChildAt(1).setText('200 Click Power');
} else if (upgradeButtons[i].upgradeType === 'click500x') {
upgradeButtons[i].getChildAt(1).setText('500 Click Power');
} else if (upgradeButtons[i].upgradeType === 'auto1') {
upgradeButtons[i].getChildAt(1).setText('Auto Clicker');
} else if (upgradeButtons[i].upgradeType === 'auto2') {
upgradeButtons[i].getChildAt(1).setText('Super Auto');
}
upgradeButtons[i].getChildAt(2).setText('$' + formatNumber(upgradeButtons[i].cost)); // Reset the cost text
}
// Reset upgrades
for (var i = 0; i < upgradeData.length; i++) {
upgradeData[i].cost = upgradeData[i].cost; // Reset cost to initial value
upgradeData[i].multiplier = upgradeData[i].multiplier; // Reset multiplier to initial value
}
updateMoneyDisplay();
saveGame();
};
};
return self;
});
var UpgradeButton = Container.expand(function () {
var self = Container.call(this);
self.upgradeType = '';
self.cost = 0;
self.multiplier = 1;
self.purchased = false;
var buttonGraphics = self.attachAsset('upgradeButton', {
anchorX: 0.5,
anchorY: 0.15,
scaleX: 1.1 // Increase width by 10%
});
var titleText = self.addChild(new Text2('Upgrade', {
size: 40,
fill: 0xffffff
}));
titleText.anchor.set(0.5, 0.5);
titleText.y = 35;
var costText = self.addChild(new Text2('$0', {
size: 40,
fill: 0xffffff
}));
costText.anchor.set(0.5, 0.5);
costText.y = 90;
self.setup = function (type, baseCost, mult) {
self.upgradeType = type;
self.cost = baseCost;
self.multiplier = mult;
if (type === 'click2x') {
titleText.setText('💰 2 Click Power');
} else if (type === 'click8x') {
titleText.setText('🚀 10 Click Power');
} else if (type === 'click5x') {
titleText.setText('⭐ 5 Click Power');
} else if (type === 'click10x') {
titleText.setText('🔥 10 Click Power');
} else if (type === 'click50x') {
titleText.setText('💎 50 Click Power');
} else if (type === 'click200x') {
titleText.setText('👑 200 Click Power');
} else if (type === 'click500x') {
titleText.setText('🌟 500 Click Power');
} else if (type === 'auto1') {
titleText.setText('🤖 Auto Clicker');
} else if (type === 'click1000x') {
titleText.setText('1000 Click Power');
titleText.setText('⚡ 1000 Click Power');
}
self.updateDisplay();
};
self.updateDisplay = function () {
costText.setText('$' + formatNumber(self.cost));
if (money >= self.cost && !self.purchased) {
buttonGraphics.tint = 0xffffff;
} else {
buttonGraphics.tint = 0x666666;
}
};
self.down = function (x, y, obj) {
// Prevent clicking when dialog is open
if (isDialogOpen) {
return;
}
if (money >= self.cost && !self.purchased) {
money -= self.cost;
self.purchased = true;
if (self.upgradeType.startsWith('click')) {
if (self.upgradeType === 'click8x') {
moneyPerClick += 8;
} else if (self.upgradeType === 'click10x') {
moneyPerClick += 10;
} else if (self.upgradeType === 'click50x') {
moneyPerClick += 40;
} else if (self.upgradeType === 'click200x') {
moneyPerClick += 150;
} else if (self.upgradeType === 'click500x') {
moneyPerClick += 300;
} else if (self.upgradeType === 'click1000x') {
moneyPerClick += 1000;
moneyPerClick *= self.multiplier;
}
} else if (self.upgradeType.startsWith('auto')) {
if (self.upgradeType === 'auto1') {
autoClickerRate += 1;
} else if (self.upgradeType === 'auto2') {
autoClickerRate += 5;
}
}
LK.getSound('upgrade').play();
buttonGraphics.tint = 0xffffff;
titleText.setText('✅ COMPRADO');
costText.setText('');
updateMoneyDisplay();
saveGame();
}
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x1a1a1a
});
/****
* Game Code
****/
var darkOverlay; // Define darkOverlay in the global scope
var isDialogOpen = false; // Track if confirmation dialog is open
var money = storage.money || 0;
var moneyPerClick = storage.moneyPerClick || 1;
var autoClickerRate = storage.autoClickerRate || 1;
var autoClickerTimer = 0;
var moneyParticles = [];
var moneyDisplay;
var moneyPerClickDisplay;
var autoIncomeDisplay;
var autoClicksDisplay;
var moneyButton;
var upgradeButtons = [];
var bonusCoin = null;
var lastBonusCoinTime = storage.lastBonusCoinTime || 0;
var isDoubleClickActive = storage.isDoubleClickActive || false;
var doubleClickTimer = storage.doubleClickTimer || 0;
var BONUS_COIN_COOLDOWN = 300000; // 5 minutes in milliseconds
function formatNumber(num) {
if (num >= 1000000000) {
return (num / 1000000000).toFixed(1) + 'B';
} else if (num >= 1000000) {
return (num / 1000000).toFixed(1) + 'M';
} else if (num >= 1000) {
return (num / 1000).toFixed(1) + 'K';
}
return Math.floor(num).toString();
}
function updateMoneyDisplay() {
moneyDisplay.setText('💰 $' + formatNumber(money));
moneyPerClickDisplay.setText('💸 Por Click: $' + formatNumber(moneyPerClick));
for (var i = 0; i < upgradeButtons.length; i++) {
upgradeButtons[i].updateDisplay();
}
}
function saveGame() {
storage.money = money;
storage.moneyPerClick = moneyPerClick;
storage.autoClickerRate = autoClickerRate;
storage.lastBonusCoinTime = lastBonusCoinTime;
storage.isDoubleClickActive = isDoubleClickActive;
storage.doubleClickTimer = doubleClickTimer;
}
// Create animated background with more elements
var backgroundElements = [];
// Add background image
var backgroundImage = game.attachAsset('Background', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 0.128,
scaleY: 0.128
});
backgroundImage.x = 2048 / 2;
backgroundImage.y = 2732 / 2;
// Add a square below the upgrade buttons
var backgroundSquare = game.attachAsset('backgroundSquare', {
anchorX: 0.5,
anchorY: 0.5
});
backgroundSquare.x = 1524;
backgroundSquare.y = 1050; // Move it further down
game.addChild(backgroundSquare);
// Create money display
moneyDisplay = new Text2('💰 $0', {
size: 80,
fill: 0x4CAF50
});
moneyDisplay.anchor.set(0.5, 0);
moneyDisplay.x = 650;
moneyDisplay.y = 150;
game.addChild(moneyDisplay);
// Create money per click display
moneyPerClickDisplay = new Text2('💸 Por Click: $1', {
size: 40,
fill: 0x000000
});
moneyPerClickDisplay.anchor.set(0.5, 0);
moneyPerClickDisplay.x = 650;
moneyPerClickDisplay.y = 250;
game.addChild(moneyPerClickDisplay);
// Create money button
moneyButton = new MoneyButton();
moneyButton.x = 650;
moneyButton.y = 800;
moneyButton.scaleX = 1.6; // Make button 60% larger (20% smaller than previous 100% increase)
moneyButton.scaleY = 1.6; // Make button 60% larger (20% smaller than previous 100% increase)
game.addChild(moneyButton);
// Create upgrade menu title
var upgradeTitle = new Text2('🛒 MEJORAS', {
size: 60,
fill: 0x000000
});
upgradeTitle.anchor.set(0.5, 0);
upgradeTitle.x = 1524;
upgradeTitle.y = 150;
game.addChild(upgradeTitle);
// Create upgrade buttons
var upgradeData = [{
type: 'click2x',
cost: 100,
multiplier: 2
}, {
type: 'click8x',
cost: 500,
multiplier: 8
}, {
type: 'click50x',
cost: 2000,
multiplier: 50
}, {
type: 'click200x',
cost: 10000,
multiplier: 200
}, {
type: 'click500x',
cost: 50000,
multiplier: 500
}, {
type: 'click1000x',
cost: 100000,
multiplier: 1000
}];
for (var i = 0; i < upgradeData.length; i++) {
var upgradeButton = new UpgradeButton();
upgradeButton.setup(upgradeData[i].type, upgradeData[i].cost, upgradeData[i].multiplier);
upgradeButton.x = 1524; // Align with the 'UPGRADES' text
upgradeButton.y = 400 + i * 230; // Move buttons slightly up
upgradeButton.scaleX = 1.0; // Make buttons 50% narrower
game.addChild(upgradeButton);
upgradeButtons.push(upgradeButton);
}
// Update displays
updateMoneyDisplay();
// Create mute button
var muteButton = new MuteButton();
muteButton.x = 150;
muteButton.y = 2600;
game.addChild(muteButton);
// Play background music if not muted
if (!muteButton.isMuted) {
LK.playMusic('backgroundMusic');
}
// Create reset button
var resetButton = new ResetButton();
resetButton.x = 1800;
resetButton.y = 2600;
resetButton.scaleX = 1.0; // Make reset button 120% narrower
game.addChild(resetButton);
// Create timer displays
var bonusTimerDisplay = new Text2('Próxima moneda: 5:00', {
size: 70,
fill: 0xffd700
});
bonusTimerDisplay.anchor.set(0.5, 0);
bonusTimerDisplay.x = 2048 / 2;
bonusTimerDisplay.y = 2580;
game.addChild(bonusTimerDisplay);
var doubleEffectDisplay = new Text2('', {
size: 70,
fill: 0xff4444
});
doubleEffectDisplay.anchor.set(0.5, 0);
doubleEffectDisplay.x = 2048 / 2;
doubleEffectDisplay.y = 2570;
game.addChild(doubleEffectDisplay);
// Game update loop
game.update = function () {
// Auto clicker functionality
if (autoClickerRate > 0) {
autoClickerTimer++;
if (autoClickerTimer >= 12) {
// 60 ticks per second / 5 = 12 ticks for 5 clicks per second
autoClickerTimer = 0;
money += moneyPerClick;
updateMoneyDisplay();
}
}
// Bonus coin timer logic
var currentTime = Date.now();
if (!bonusCoin && !isDoubleClickActive && currentTime - lastBonusCoinTime >= BONUS_COIN_COOLDOWN) {
// Spawn bonus coin at random position avoiding all UI elements
bonusCoin = new BonusCoin();
var attempts = 0;
var validPosition = false;
while (!validPosition && attempts < 50) {
var randomX = 200 + Math.random() * 1648; // Keep within safe bounds
var randomY = 350 + Math.random() * 1900; // Keep within safe bounds
// Check if position is too close to money button (radius check)
var distanceToMoneyButton = Math.sqrt(Math.pow(randomX - moneyButton.x, 2) + Math.pow(randomY - moneyButton.y, 2));
// Check if position is too close to upgrade buttons area (expanded)
var tooCloseToUpgrades = randomX > 1150 && randomX < 1900 && randomY > 150 && randomY < 1400;
// Check if position is too close to bottom buttons (expanded)
var tooCloseToBottomButtons = randomY > 2350;
// Check if position is too close to background square (expanded)
var distanceToBackgroundSquare = Math.sqrt(Math.pow(randomX - backgroundSquare.x, 2) + Math.pow(randomY - backgroundSquare.y, 2));
var tooCloseToBackgroundSquare = distanceToBackgroundSquare < 700; // Increased safe distance
// Check if position is too close to money display area
var tooCloseToMoneyDisplay = randomX > 400 && randomX < 900 && randomY > 100 && randomY < 350;
// Check if position is too close to timer displays at bottom
var tooCloseToTimerDisplays = randomY > 2450;
// Check if position is too close to left/right edges
var tooCloseToEdges = randomX < 150 || randomX > 1900;
// Check if position is too close to any button
var tooCloseToAnyButton = distanceToMoneyButton < 450 || tooCloseToUpgrades || tooCloseToBottomButtons || tooCloseToBackgroundSquare || tooCloseToMoneyDisplay || tooCloseToTimerDisplays || tooCloseToEdges;
if (!tooCloseToAnyButton) {
validPosition = true;
bonusCoin.x = randomX;
bonusCoin.y = randomY;
} else {
attempts++;
}
}
// Fallback position if no valid position found (safe area in middle-left)
if (!validPosition) {
bonusCoin.x = 400;
bonusCoin.y = 1800;
}
game.addChild(bonusCoin);
}
// Handle double click effect countdown
if (isDoubleClickActive) {
doubleClickTimer--;
if (doubleClickTimer <= 0) {
isDoubleClickActive = false;
doubleClickTimer = 0;
lastBonusCoinTime = Date.now(); // Reset timer when effect ends
storage.isDoubleClickActive = false;
storage.doubleClickTimer = 0;
storage.lastBonusCoinTime = lastBonusCoinTime;
}
}
// Update timer displays
if (isDoubleClickActive) {
var remainingSeconds = Math.ceil(doubleClickTimer / 60);
var minutes = Math.floor(remainingSeconds / 60);
var seconds = remainingSeconds % 60;
doubleEffectDisplay.setText('Doble click: ' + minutes + ':' + (seconds < 10 ? '0' : '') + seconds);
bonusTimerDisplay.setText('');
} else {
doubleEffectDisplay.setText('');
var timeRemaining = BONUS_COIN_COOLDOWN - (currentTime - lastBonusCoinTime);
if (timeRemaining > 0) {
var remainingSeconds = Math.ceil(timeRemaining / 1000);
var minutes = Math.floor(remainingSeconds / 60);
var seconds = remainingSeconds % 60;
bonusTimerDisplay.setText('Próxima moneda: ' + minutes + ':' + (seconds < 10 ? '0' : '') + seconds);
} else {
bonusTimerDisplay.setText('¡Moneda disponible!');
}
}
// Update particles
for (var i = moneyParticles.length - 1; i >= 0; i--) {
var particle = moneyParticles[i];
if (particle.shouldDestroy) {
particle.destroy();
moneyParticles.splice(i, 1);
}
}
// Auto save every 5 seconds
if (LK.ticks % 300 === 0) {
saveGame();
}
};
Haz una moneda 2d pero un pixel. In-Game asset. 2d. High contrast. No shadows
haz un boton tipo pixel. In-Game asset. 2d. High contrast. No shadows
creame un paisage pixer de 2048x2732. In-Game asset. 2d. High contrast. No shadows
crea una caja de madera que este el medio vacio solo hacme el marco y un color de madera oscura en el centro. In-Game asset. 2d. High contrast. No shadows
haz una caja con bordes estrechos y el fondo de color madera oscuro. In-Game asset. 2d. High contrast. No shadows