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 ConfirmDialog = Container.expand(function () {
var self = Container.call(this);
var dialogGraphics = self.attachAsset('resetButton', {
anchorX: 0.5,
anchorY: 0.5
});
var confirmText = self.addChild(new Text2('Estas seguro?', {
size: 50,
fill: 0xFFFFFF
}));
confirmText.anchor.set(0.5, 0.5);
confirmText.y = -30;
var confirmButton = self.attachAsset('resetButton', {
anchorX: 0.5,
anchorY: 0.5
});
confirmButton.y = 0;
var buttonText = confirmButton.addChild(new Text2('Confirmar', {
size: 40,
fill: 0xFFFFFF
}));
buttonText.anchor.set(0.5, 0.5);
confirmButton.down = function (x, y, obj) {
if (self.onConfirm) self.onConfirm();
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: 0xFFFFFF
}));
moneyText.anchor.set(0.5, 0.5);
self.down = function (x, y, obj) {
tween(buttonGraphics, {
scaleX: 0.9,
scaleY: 0.9
}, {
duration: 50
});
LK.getSound('coinClick').play();
var earned = moneyPerClick;
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: 0xFFFFFF
}));
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 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: 0xFFFFFF
}));
resetText.anchor.set(0.5, 0.5);
self.down = function (x, y, obj) {
// 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();
}
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.5
});
var titleText = self.addChild(new Text2('Upgrade', {
size: 40,
fill: 0xFFFFFF
}));
titleText.anchor.set(0.5, 0.5);
titleText.y = -25;
var costText = self.addChild(new Text2('$0', {
size: 35,
fill: 0xFFFFFF
}));
costText.anchor.set(0.5, 0.5);
costText.y = 25;
self.setup = function (type, baseCost, mult) {
self.upgradeType = type;
self.cost = baseCost;
self.multiplier = mult;
if (type === 'click2x') {
titleText.setText('2x Click Power');
} else if (type === 'click5x') {
titleText.setText('5x Click Power');
} else if (type === 'click10x') {
titleText.setText('10x Click Power');
} else if (type === 'auto1') {
titleText.setText('Auto Clicker');
} else if (type === 'auto2') {
titleText.setText('Super Auto');
}
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) {
if (money >= self.cost && !self.purchased) {
money -= self.cost;
self.purchased = true;
if (self.upgradeType.startsWith('click')) {
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 = 0x4CAF50;
titleText.setText('PURCHASED');
costText.setText('');
updateMoneyDisplay();
saveGame();
}
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x1a1a1a
});
/****
* Game Code
****/
var money = storage.money || 0;
var moneyPerClick = storage.moneyPerClick || 1;
var autoClickerRate = storage.autoClickerRate || 2;
var autoClickerValue = 2; // New variable to store the value per auto click
var autoClickerTimer = 0;
var moneyParticles = [];
var moneyDisplay;
var moneyPerClickDisplay;
var autoIncomeDisplay;
var moneyButton;
var upgradeButtons = [];
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('Per Click: $' + formatNumber(moneyPerClick));
autoIncomeDisplay.setText('Auto: $' + formatNumber(autoClickerRate) + '/sec');
for (var i = 0; i < upgradeButtons.length; i++) {
upgradeButtons[i].updateDisplay();
}
}
function saveGame() {
storage.money = money;
storage.moneyPerClick = moneyPerClick;
storage.autoClickerRate = autoClickerRate;
}
// Create money display
moneyDisplay = new Text2('$0', {
size: 80,
fill: 0x4CAF50
});
moneyDisplay.anchor.set(0.5, 0);
moneyDisplay.x = 500;
moneyDisplay.y = 150;
game.addChild(moneyDisplay);
// Create money per click display
moneyPerClickDisplay = new Text2('Per Click: $1', {
size: 40,
fill: 0xFFFFFF
});
moneyPerClickDisplay.anchor.set(0.5, 0);
moneyPerClickDisplay.x = 500;
moneyPerClickDisplay.y = 250;
game.addChild(moneyPerClickDisplay);
// Create auto income display
autoIncomeDisplay = new Text2('Auto: $0/sec', {
size: 40,
fill: 0xFFFFFF
});
autoIncomeDisplay.anchor.set(0.5, 0);
autoIncomeDisplay.x = 500;
autoIncomeDisplay.y = 310;
game.addChild(autoIncomeDisplay);
// Create money button
moneyButton = new MoneyButton();
moneyButton.x = 500;
moneyButton.y = 800;
game.addChild(moneyButton);
// Create upgrade menu title
var upgradeTitle = new Text2('UPGRADES', {
size: 60,
fill: 0xFFFFFF
});
upgradeTitle.anchor.set(0.5, 0);
upgradeTitle.x = 1524;
upgradeTitle.y = 150;
game.addChild(upgradeTitle);
// Create upgrade buttons
var upgradeData = [{
type: 'click2x',
cost: 50,
multiplier: 2
}, {
type: 'auto1',
cost: 100,
multiplier: 1
}, {
type: 'click5x',
cost: 500,
multiplier: 5
}, {
type: 'auto2',
cost: 1000,
multiplier: 5
}, {
type: 'click10x',
cost: 5000,
multiplier: 10
}];
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;
upgradeButton.y = 350 + i * 150;
game.addChild(upgradeButton);
upgradeButtons.push(upgradeButton);
}
// Update displays
updateMoneyDisplay();
// Create reset button
var resetButton = new ResetButton();
resetButton.x = 1800;
resetButton.y = 2600;
game.addChild(resetButton);
// Game update loop
game.update = function () {
// Auto clicker logic
if (autoClickerRate > 0) {
autoClickerTimer++;
if (autoClickerTimer >= 60) {
autoClickerTimer = 0;
money += autoClickerRate; // Revert to original logic to give 1 dollar per second
updateMoneyDisplay();
saveGame();
}
}
// 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();
}
}; ===================================================================
--- original.js
+++ change.js
@@ -322,9 +322,9 @@
if (autoClickerRate > 0) {
autoClickerTimer++;
if (autoClickerTimer >= 60) {
autoClickerTimer = 0;
- money += autoClickerRate * autoClickerValue; // Multiply rate by value per auto click to give 2 dollars per second
+ money += autoClickerRate; // Revert to original logic to give 1 dollar per second
updateMoneyDisplay();
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