Code edit (2 edits merged)
Please save this source code
User prompt
desace lo ultimo que te dije
User prompt
haz que los quadrados del fondo no interfieran mucho en el rendimiento
User prompt
elimina los quadrados blancos y añade mas de colores del fondo ↪💡 Consider importing and using the following plugins: @upit/tween.v1
Code edit (1 edits merged)
Please save this source code
User prompt
borra los quadrados blancos que hay blancos que molesta y tapan los botones ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
ahora añade mas quadrados al fondo ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
el fondo hazlo tipo pixel que el juego va de eso ↪💡 Consider importing and using the following plugins: @upit/tween.v1
Code edit (4 edits merged)
Please save this source code
User prompt
pon en el fondo un poquito mas de figuras y de diferentes colores ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
pon un fondo bonito con un poquito de movimineto ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
quita el quadrado rojo que hay quando pulsas el boton de reiniciar andentro
User prompt
el boton de confirma quando pulsas reiniciar hazlo un poco mas abajo
User prompt
el boton de confirma quando pulsas reiniciar hazlo un poco mas abajo
User prompt
Cambia un poco las letras del juego para que sea un poco mas llamativo
Code edit (1 edits merged)
Please save this source code
User prompt
haz 2 botones mas de mejora uno que ponga 200 click por click y otro de 500 clicks por click
User prompt
borra el boton de 5 clicks pr segundo
User prompt
arregla el boton de 5 clicks por segundo, son 5 no 10
User prompt
ahora añade otro boton de mejora que te de 5 click por segundo automaticamente y abajo del texto "Per Click: $1" haz un contador para cada vez que añada un boton de estos incremente la cantidad que diga el boton
Code edit (2 edits merged)
Please save this source code
User prompt
haz otro boton de mejora el qual te de +50 por click
User prompt
el boton de mutear la musica ponlo abajo a la izquierda
User prompt
haz un boton de mutear musica y que funcione
User prompt
elimina el boton de auto click
/****
* 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 confirmText = self.addChild(new Text2('⚠️ ¿Estás 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 = 100;
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();
}
darkOverlay.destroy(); // Remove the dark overlay when confirmed
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 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: 0xFFFFFF
}));
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) {
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: 0xFFFFFF
}));
resetText.anchor.set(0.5, 0.5);
self.down = function (x, y, obj) {
// Darken the background
darkOverlay = LK.getAsset('resetButton', {
width: 2048,
height: 2732,
alpha: 0.5,
interactive: true,
tint: 0x000000
});
game.addChild(darkOverlay);
var confirmDialog = new ConfirmDialog();
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();
};
game.addChild(confirmDialog);
confirmDialog.x = 2048 / 2;
confirmDialog.y = 2732 / 2;
confirmDialog.onConfirm = function () {
// 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('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();
};
game.addChild(confirmDialog);
};
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.1
});
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 === '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')) {
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 {
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('✅ 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 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 = [];
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;
}
// Create animated background
var backgroundElements = [];
// Create pixelated blocks - variant 1
for (var i = 0; i < 8; i++) {
var pixelBlock = LK.getAsset('pixelBlock1', {
anchorX: 0.5,
anchorY: 0.5,
alpha: 0.15
});
pixelBlock.x = Math.random() * 2048;
pixelBlock.y = Math.random() * 2732;
pixelBlock.scaleX = 1 + Math.random() * 0.5;
pixelBlock.scaleY = pixelBlock.scaleX;
pixelBlock.initialY = pixelBlock.y;
game.addChildAt(pixelBlock, 0); // Add at bottom layer
backgroundElements.push(pixelBlock);
// Pixelated movement - sharp steps
tween(pixelBlock, {
y: pixelBlock.y - 120
}, {
duration: 2000 + Math.random() * 1000,
easing: tween.linear,
onFinish: function () {
var elem = this;
tween(elem, {
y: elem.initialY + 120
}, {
duration: 2000 + Math.random() * 1000,
easing: tween.linear,
onFinish: function onFinish() {
// Loop back to original animation
tween(this, {
y: this.initialY - 120
}, {
duration: 2000 + Math.random() * 1000,
easing: tween.linear
});
}
});
}.bind(pixelBlock)
});
// No rotation for pixel blocks to keep sharp edges
}
// Create pixelated blocks - variant 2
for (var i = 0; i < 7; i++) {
var pixelBlock2 = LK.getAsset('pixelBlock2', {
anchorX: 0.5,
anchorY: 0.5,
alpha: 0.18
});
pixelBlock2.x = Math.random() * 2048;
pixelBlock2.y = Math.random() * 2732;
pixelBlock2.scaleX = 0.8 + Math.random() * 0.4;
pixelBlock2.scaleY = pixelBlock2.scaleX;
pixelBlock2.initialY = pixelBlock2.y;
game.addChildAt(pixelBlock2, 0);
backgroundElements.push(pixelBlock2);
// Sharp movement for pixel blocks
tween(pixelBlock2, {
y: pixelBlock2.y - 100
}, {
duration: 1800 + Math.random() * 1200,
easing: tween.linear,
onFinish: function () {
var elem = this;
tween(elem, {
y: elem.initialY + 100
}, {
duration: 1800 + Math.random() * 1200,
easing: tween.linear,
onFinish: function onFinish() {
tween(this, {
y: this.initialY - 100
}, {
duration: 1800 + Math.random() * 1200,
easing: tween.linear
});
}
});
}.bind(pixelBlock2)
});
}
// Create small pixelated blocks - variant 3
for (var i = 0; i < 10; i++) {
var pixelBlock3 = LK.getAsset('pixelBlock3', {
anchorX: 0.5,
anchorY: 0.5,
alpha: 0.20
});
pixelBlock3.x = Math.random() * 2048;
pixelBlock3.y = Math.random() * 2732;
pixelBlock3.scaleX = 1 + Math.random() * 0.5;
pixelBlock3.scaleY = pixelBlock3.scaleX;
pixelBlock3.initialY = pixelBlock3.y;
game.addChildAt(pixelBlock3, 0);
backgroundElements.push(pixelBlock3);
// Fast pixelated movement
tween(pixelBlock3, {
y: pixelBlock3.y - 60
}, {
duration: 1500 + Math.random() * 800,
easing: tween.linear,
onFinish: function () {
var elem = this;
tween(elem, {
y: elem.initialY + 60
}, {
duration: 1500 + Math.random() * 800,
easing: tween.linear,
onFinish: function onFinish() {
tween(this, {
y: this.initialY - 60
}, {
duration: 1500 + Math.random() * 800,
easing: tween.linear
});
}
});
}.bind(pixelBlock3)
});
}
// Removed white background squares that were obstructing buttons
// Create floating squares - red variant
for (var i = 0; i < 5; i++) {
var redSquare = LK.getAsset('backgroundSquareRed', {
anchorX: 0.5,
anchorY: 0.5,
alpha: 0.10
});
redSquare.x = Math.random() * 2048;
redSquare.y = Math.random() * 2732;
redSquare.scaleX = 0.4 + Math.random() * 0.3;
redSquare.scaleY = redSquare.scaleX;
redSquare.rotation = Math.random() * Math.PI;
game.addChildAt(redSquare, 0);
backgroundElements.push(redSquare);
// Rotation animation for red squares
tween(redSquare, {
rotation: redSquare.rotation - Math.PI * 2
}, {
duration: 10000 + Math.random() * 4000,
easing: tween.linear
});
// Scale pulsing for red squares
tween(redSquare, {
scaleX: redSquare.scaleX * 1.4,
scaleY: redSquare.scaleY * 1.4
}, {
duration: 3500 + Math.random() * 1500,
easing: tween.easeInOut,
onFinish: function () {
var elem = this;
tween(elem, {
scaleX: elem.scaleX * 0.6,
scaleY: elem.scaleY * 0.6
}, {
duration: 3500 + Math.random() * 1500,
easing: tween.easeInOut
});
}.bind(redSquare)
});
}
// Removed orange background squares that were obstructing buttons
// Create additional pixel blocks for more density
for (var i = 0; i < 15; i++) {
var pixelVariant = ['pixelBlock8', 'pixelBlock9', 'pixelBlock10'][i % 3];
var pixelBlock = LK.getAsset(pixelVariant, {
anchorX: 0.5,
anchorY: 0.5,
alpha: 0.25
});
pixelBlock.x = Math.random() * 2048;
pixelBlock.y = Math.random() * 2732;
pixelBlock.scaleX = 1 + Math.random() * 0.8;
pixelBlock.scaleY = pixelBlock.scaleX;
pixelBlock.initialX = pixelBlock.x;
pixelBlock.initialY = pixelBlock.y;
game.addChildAt(pixelBlock, 0);
backgroundElements.push(pixelBlock);
// Horizontal pixel movement
tween(pixelBlock, {
x: pixelBlock.x + (Math.random() > 0.5 ? 80 : -80)
}, {
duration: 2000 + Math.random() * 1000,
easing: tween.linear
});
// Vertical pixel movement
tween(pixelBlock, {
y: pixelBlock.y + (Math.random() > 0.5 ? 60 : -60)
}, {
duration: 2500 + Math.random() * 1500,
easing: tween.linear,
onFinish: function () {
var elem = this;
tween(elem, {
y: elem.initialY
}, {
duration: 2500 + Math.random() * 1500,
easing: tween.linear
});
}.bind(pixelBlock)
});
}
// Create even more pixelated squares using existing variants
for (var i = 0; i < 12; i++) {
var pixelVariant = ['pixelBlock4', 'pixelBlock5', 'pixelBlock6', 'pixelBlock7'][i % 4];
var pixelSquare = LK.getAsset(pixelVariant, {
anchorX: 0.5,
anchorY: 0.5,
alpha: 0.15
});
pixelSquare.x = Math.random() * 2048;
pixelSquare.y = Math.random() * 2732;
pixelSquare.scaleX = 0.6 + Math.random() * 0.6;
pixelSquare.scaleY = pixelSquare.scaleX;
pixelSquare.initialX = pixelSquare.x;
pixelSquare.initialY = pixelSquare.y;
game.addChildAt(pixelSquare, 0);
backgroundElements.push(pixelSquare);
// Different movement pattern for variety
tween(pixelSquare, {
x: pixelSquare.x + (Math.random() > 0.5 ? 100 : -100),
y: pixelSquare.y + (Math.random() > 0.5 ? 80 : -80)
}, {
duration: 3000 + Math.random() * 1500,
easing: tween.linear,
onFinish: function () {
var elem = this;
tween(elem, {
x: elem.initialX,
y: elem.initialY
}, {
duration: 3000 + Math.random() * 1500,
easing: tween.linear
});
}.bind(pixelSquare)
});
}
// Add more colorful pixelated blocks for enhanced background
for (var i = 0; i < 20; i++) {
var colorVariant = ['pixelBlock1', 'pixelBlock2', 'pixelBlock3', 'pixelBlock8', 'pixelBlock9'][i % 5];
var colorBlock = LK.getAsset(colorVariant, {
anchorX: 0.5,
anchorY: 0.5,
alpha: 0.20
});
colorBlock.x = Math.random() * 2048;
colorBlock.y = Math.random() * 2732;
colorBlock.scaleX = 0.8 + Math.random() * 0.7;
colorBlock.scaleY = colorBlock.scaleX;
colorBlock.initialX = colorBlock.x;
colorBlock.initialY = colorBlock.y;
game.addChildAt(colorBlock, 0);
backgroundElements.push(colorBlock);
// Diagonal movement for color blocks
tween(colorBlock, {
x: colorBlock.x + (Math.random() > 0.5 ? 150 : -150),
y: colorBlock.y + (Math.random() > 0.5 ? 120 : -120)
}, {
duration: 4000 + Math.random() * 2000,
easing: tween.easeInOut,
onFinish: function () {
var elem = this;
tween(elem, {
x: elem.initialX,
y: elem.initialY
}, {
duration: 4000 + Math.random() * 2000,
easing: tween.easeInOut
});
}.bind(colorBlock)
});
}
// Add floating colorful squares using background square variants
for (var i = 0; i < 8; i++) {
var squareVariant = ['backgroundSquare', 'backgroundSquareRed'][i % 2];
var floatingSquare = LK.getAsset(squareVariant, {
anchorX: 0.5,
anchorY: 0.5,
alpha: 0.12
});
floatingSquare.x = Math.random() * 2048;
floatingSquare.y = Math.random() * 2732;
floatingSquare.scaleX = 0.3 + Math.random() * 0.4;
floatingSquare.scaleY = floatingSquare.scaleX;
floatingSquare.rotation = Math.random() * Math.PI;
floatingSquare.initialRotation = floatingSquare.rotation;
game.addChildAt(floatingSquare, 0);
backgroundElements.push(floatingSquare);
// Continuous rotation for floating squares
tween(floatingSquare, {
rotation: floatingSquare.rotation + Math.PI * 4
}, {
duration: 12000 + Math.random() * 6000,
easing: tween.linear
});
// Scale animation for floating squares
tween(floatingSquare, {
scaleX: floatingSquare.scaleX * 1.6,
scaleY: floatingSquare.scaleY * 1.6
}, {
duration: 4000 + Math.random() * 2000,
easing: tween.easeInOut,
onFinish: function () {
var elem = this;
tween(elem, {
scaleX: elem.scaleX * 0.5,
scaleY: elem.scaleY * 0.5
}, {
duration: 4000 + Math.random() * 2000,
easing: tween.easeInOut
});
}.bind(floatingSquare)
});
}
// 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: 0xFFFFFF
});
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;
game.addChild(moneyButton);
// Create upgrade menu title
var upgradeTitle = new Text2('🛒 MEJORAS', {
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: 'click8x',
cost: 200,
multiplier: 8
}, {
type: 'click50x',
cost: 1000,
multiplier: 50
}, {
type: 'click200x',
cost: 5000,
multiplier: 200
}, {
type: 'click500x',
cost: 20000,
multiplier: 500
}];
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 = 250 + i * 200; // Position below the 'UPGRADES' text
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;
game.addChild(resetButton);
// 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();
}
}
// Update particles
for (var i = moneyParticles.length - 1; i >= 0; i--) {
var particle = moneyParticles[i];
if (particle.shouldDestroy) {
particle.destroy();
moneyParticles.splice(i, 1);
}
}
// Animate background elements
for (var i = 0; i < backgroundElements.length; i++) {
var element = backgroundElements[i];
// Add subtle continuous movement
if (LK.ticks % 240 === 0) {
// Every 4 seconds
var newX = element.x + (Math.random() - 0.5) * 200;
var newY = element.y + (Math.random() - 0.5) * 150;
// Keep within bounds
newX = Math.max(100, Math.min(1948, newX));
newY = Math.max(100, Math.min(2632, newY));
tween(element, {
x: newX,
y: newY
}, {
duration: 3000 + Math.random() * 2000,
easing: tween.easeInOut
});
}
// Add subtle alpha pulsing
if (LK.ticks % 120 === i * 20) {
// Stagger the pulsing
tween(element, {
alpha: element.alpha * 1.5
}, {
duration: 1000,
easing: tween.easeInOut,
onFinish: function () {
tween(this, {
alpha: this.alpha * 0.7
}, {
duration: 1000,
easing: tween.easeInOut
});
}.bind(element)
});
}
}
// Auto save every 5 seconds
if (LK.ticks % 300 === 0) {
saveGame();
}
}; ===================================================================
--- original.js
+++ change.js
@@ -303,9 +303,9 @@
moneyPerClick += 40;
} else if (self.upgradeType === 'click200x') {
moneyPerClick += 150;
} else if (self.upgradeType === 'click500x') {
- moneyPerClick += 350;
+ moneyPerClick += 300;
} else {
moneyPerClick *= self.multiplier;
}
} else if (self.upgradeType.startsWith('auto')) {
@@ -607,8 +607,85 @@
});
}.bind(pixelSquare)
});
}
+// Add more colorful pixelated blocks for enhanced background
+for (var i = 0; i < 20; i++) {
+ var colorVariant = ['pixelBlock1', 'pixelBlock2', 'pixelBlock3', 'pixelBlock8', 'pixelBlock9'][i % 5];
+ var colorBlock = LK.getAsset(colorVariant, {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ alpha: 0.20
+ });
+ colorBlock.x = Math.random() * 2048;
+ colorBlock.y = Math.random() * 2732;
+ colorBlock.scaleX = 0.8 + Math.random() * 0.7;
+ colorBlock.scaleY = colorBlock.scaleX;
+ colorBlock.initialX = colorBlock.x;
+ colorBlock.initialY = colorBlock.y;
+ game.addChildAt(colorBlock, 0);
+ backgroundElements.push(colorBlock);
+ // Diagonal movement for color blocks
+ tween(colorBlock, {
+ x: colorBlock.x + (Math.random() > 0.5 ? 150 : -150),
+ y: colorBlock.y + (Math.random() > 0.5 ? 120 : -120)
+ }, {
+ duration: 4000 + Math.random() * 2000,
+ easing: tween.easeInOut,
+ onFinish: function () {
+ var elem = this;
+ tween(elem, {
+ x: elem.initialX,
+ y: elem.initialY
+ }, {
+ duration: 4000 + Math.random() * 2000,
+ easing: tween.easeInOut
+ });
+ }.bind(colorBlock)
+ });
+}
+// Add floating colorful squares using background square variants
+for (var i = 0; i < 8; i++) {
+ var squareVariant = ['backgroundSquare', 'backgroundSquareRed'][i % 2];
+ var floatingSquare = LK.getAsset(squareVariant, {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ alpha: 0.12
+ });
+ floatingSquare.x = Math.random() * 2048;
+ floatingSquare.y = Math.random() * 2732;
+ floatingSquare.scaleX = 0.3 + Math.random() * 0.4;
+ floatingSquare.scaleY = floatingSquare.scaleX;
+ floatingSquare.rotation = Math.random() * Math.PI;
+ floatingSquare.initialRotation = floatingSquare.rotation;
+ game.addChildAt(floatingSquare, 0);
+ backgroundElements.push(floatingSquare);
+ // Continuous rotation for floating squares
+ tween(floatingSquare, {
+ rotation: floatingSquare.rotation + Math.PI * 4
+ }, {
+ duration: 12000 + Math.random() * 6000,
+ easing: tween.linear
+ });
+ // Scale animation for floating squares
+ tween(floatingSquare, {
+ scaleX: floatingSquare.scaleX * 1.6,
+ scaleY: floatingSquare.scaleY * 1.6
+ }, {
+ duration: 4000 + Math.random() * 2000,
+ easing: tween.easeInOut,
+ onFinish: function () {
+ var elem = this;
+ tween(elem, {
+ scaleX: elem.scaleX * 0.5,
+ scaleY: elem.scaleY * 0.5
+ }, {
+ duration: 4000 + Math.random() * 2000,
+ easing: tween.easeInOut
+ });
+ }.bind(floatingSquare)
+ });
+}
// Create money display
moneyDisplay = new Text2('💰 $0', {
size: 80,
fill: 0x4CAF50
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