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 += 350;
} 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)
});
}
// Create floating squares - original green
for (var i = 0; i < 4; i++) {
var square = LK.getAsset('backgroundSquare', {
anchorX: 0.5,
anchorY: 0.5,
alpha: 0.08
});
square.x = Math.random() * 2048;
square.y = Math.random() * 2732;
square.scaleX = 0.3 + Math.random() * 0.4;
square.scaleY = square.scaleX;
square.rotation = Math.random() * Math.PI;
game.addChildAt(square, 0); // Add at bottom layer
backgroundElements.push(square);
// Slow rotation animation
tween(square, {
rotation: square.rotation + Math.PI * 2
}, {
duration: 12000 + Math.random() * 6000,
easing: tween.linear
});
// Slow scale pulsing
tween(square, {
scaleX: square.scaleX * 1.3,
scaleY: square.scaleY * 1.3
}, {
duration: 4000 + Math.random() * 2000,
easing: tween.easeInOut,
onFinish: function () {
var elem = this;
tween(elem, {
scaleX: elem.scaleX * 0.7,
scaleY: elem.scaleY * 0.7
}, {
duration: 4000 + Math.random() * 2000,
easing: tween.easeInOut
});
}.bind(square)
});
}
// 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)
});
}
// Create floating squares - orange variant
for (var i = 0; i < 4; i++) {
var orangeSquare = LK.getAsset('backgroundSquareOrange', {
anchorX: 0.5,
anchorY: 0.5,
alpha: 0.07
});
orangeSquare.x = Math.random() * 2048;
orangeSquare.y = Math.random() * 2732;
orangeSquare.scaleX = 0.2 + Math.random() * 0.5;
orangeSquare.scaleY = orangeSquare.scaleX;
orangeSquare.rotation = Math.random() * Math.PI;
game.addChildAt(orangeSquare, 0);
backgroundElements.push(orangeSquare);
// Rotation animation for orange squares
tween(orangeSquare, {
rotation: orangeSquare.rotation + Math.PI * 3
}, {
duration: 15000 + Math.random() * 5000,
easing: tween.linear
});
// Scale pulsing for orange squares
tween(orangeSquare, {
scaleX: orangeSquare.scaleX * 1.2,
scaleY: orangeSquare.scaleY * 1.2
}, {
duration: 5000 + Math.random() * 2000,
easing: tween.easeInOut,
onFinish: function () {
var elem = this;
tween(elem, {
scaleX: elem.scaleX * 0.8,
scaleY: elem.scaleY * 0.8
}, {
duration: 5000 + Math.random() * 2000,
easing: tween.easeInOut
});
}.bind(orangeSquare)
});
}
// Create additional pixel blocks for more density
for (var i = 0; i < 8; 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 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: 15000,
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
@@ -371,147 +371,126 @@
storage.autoClickerRate = autoClickerRate;
}
// Create animated background
var backgroundElements = [];
-// Create floating circles - original green
-for (var i = 0; i < 6; i++) {
- var circle = LK.getAsset('backgroundCircle', {
+// 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.1
+ alpha: 0.15
});
- circle.x = Math.random() * 2048;
- circle.y = Math.random() * 2732;
- circle.scaleX = 0.5 + Math.random() * 0.5;
- circle.scaleY = circle.scaleX;
- circle.initialY = circle.y;
- circle.speed = 0.5 + Math.random() * 1;
- game.addChildAt(circle, 0); // Add at bottom layer
- backgroundElements.push(circle);
- // Start floating animation
- tween(circle, {
- y: circle.y - 100
+ 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: 3000 + Math.random() * 2000,
- easing: tween.easeInOut,
+ duration: 2000 + Math.random() * 1000,
+ easing: tween.linear,
onFinish: function () {
var elem = this;
tween(elem, {
- y: elem.initialY + 100
+ y: elem.initialY + 120
}, {
- duration: 3000 + Math.random() * 2000,
- easing: tween.easeInOut,
+ duration: 2000 + Math.random() * 1000,
+ easing: tween.linear,
onFinish: function onFinish() {
// Loop back to original animation
tween(this, {
- y: this.initialY - 100
+ y: this.initialY - 120
}, {
- duration: 3000 + Math.random() * 2000,
- easing: tween.easeInOut
+ duration: 2000 + Math.random() * 1000,
+ easing: tween.linear
});
}
});
- }.bind(circle)
+ }.bind(pixelBlock)
});
- // Add rotation
- tween(circle, {
- rotation: Math.PI * 2
- }, {
- duration: 8000 + Math.random() * 4000,
- easing: tween.linear
- });
+ // No rotation for pixel blocks to keep sharp edges
}
-// Create floating circles - blue variant
-for (var i = 0; i < 5; i++) {
- var blueCircle = LK.getAsset('backgroundCircleBlue', {
+// 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.12
+ alpha: 0.18
});
- blueCircle.x = Math.random() * 2048;
- blueCircle.y = Math.random() * 2732;
- blueCircle.scaleX = 0.4 + Math.random() * 0.6;
- blueCircle.scaleY = blueCircle.scaleX;
- blueCircle.initialY = blueCircle.y;
- game.addChildAt(blueCircle, 0);
- backgroundElements.push(blueCircle);
- // Floating animation for blue circles
- tween(blueCircle, {
- y: blueCircle.y - 120
+ 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: 2500 + Math.random() * 2500,
- easing: tween.easeInOut,
+ duration: 1800 + Math.random() * 1200,
+ easing: tween.linear,
onFinish: function () {
var elem = this;
tween(elem, {
- y: elem.initialY + 120
+ y: elem.initialY + 100
}, {
- duration: 2500 + Math.random() * 2500,
- easing: tween.easeInOut,
+ duration: 1800 + Math.random() * 1200,
+ easing: tween.linear,
onFinish: function onFinish() {
tween(this, {
- y: this.initialY - 120
+ y: this.initialY - 100
}, {
- duration: 2500 + Math.random() * 2500,
- easing: tween.easeInOut
+ duration: 1800 + Math.random() * 1200,
+ easing: tween.linear
});
}
});
- }.bind(blueCircle)
+ }.bind(pixelBlock2)
});
- // Add rotation for blue circles
- tween(blueCircle, {
- rotation: -Math.PI * 2
- }, {
- duration: 10000 + Math.random() * 5000,
- easing: tween.linear
- });
}
-// Create floating circles - purple variant
-for (var i = 0; i < 4; i++) {
- var purpleCircle = LK.getAsset('backgroundCirclePurple', {
+// 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.09
+ alpha: 0.20
});
- purpleCircle.x = Math.random() * 2048;
- purpleCircle.y = Math.random() * 2732;
- purpleCircle.scaleX = 0.6 + Math.random() * 0.4;
- purpleCircle.scaleY = purpleCircle.scaleX;
- purpleCircle.initialY = purpleCircle.y;
- game.addChildAt(purpleCircle, 0);
- backgroundElements.push(purpleCircle);
- // Floating animation for purple circles
- tween(purpleCircle, {
- y: purpleCircle.y - 80
+ 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: 3500 + Math.random() * 1500,
- easing: tween.easeInOut,
+ duration: 1500 + Math.random() * 800,
+ easing: tween.linear,
onFinish: function () {
var elem = this;
tween(elem, {
- y: elem.initialY + 80
+ y: elem.initialY + 60
}, {
- duration: 3500 + Math.random() * 1500,
- easing: tween.easeInOut,
+ duration: 1500 + Math.random() * 800,
+ easing: tween.linear,
onFinish: function onFinish() {
tween(this, {
- y: this.initialY - 80
+ y: this.initialY - 60
}, {
- duration: 3500 + Math.random() * 1500,
- easing: tween.easeInOut
+ duration: 1500 + Math.random() * 800,
+ easing: tween.linear
});
}
});
- }.bind(purpleCircle)
+ }.bind(pixelBlock3)
});
- // Add rotation for purple circles
- tween(purpleCircle, {
- rotation: Math.PI * 1.5
- }, {
- duration: 7000 + Math.random() * 3000,
- easing: tween.linear
- });
}
// Create floating squares - original green
for (var i = 0; i < 4; i++) {
var square = LK.getAsset('backgroundSquare', {
@@ -631,46 +610,46 @@
});
}.bind(orangeSquare)
});
}
-// Create floating squares - teal variant
-for (var i = 0; i < 6; i++) {
- var tealSquare = LK.getAsset('backgroundSquareTeal', {
+// Create additional pixel blocks for more density
+for (var i = 0; i < 8; i++) {
+ var pixelVariant = ['pixelBlock8', 'pixelBlock9', 'pixelBlock10'][i % 3];
+ var pixelBlock = LK.getAsset(pixelVariant, {
anchorX: 0.5,
anchorY: 0.5,
- alpha: 0.11
+ alpha: 0.25
});
- tealSquare.x = Math.random() * 2048;
- tealSquare.y = Math.random() * 2732;
- tealSquare.scaleX = 0.5 + Math.random() * 0.4;
- tealSquare.scaleY = tealSquare.scaleX;
- tealSquare.rotation = Math.random() * Math.PI;
- game.addChildAt(tealSquare, 0);
- backgroundElements.push(tealSquare);
- // Rotation animation for teal squares
- tween(tealSquare, {
- rotation: tealSquare.rotation + Math.PI * 1.5
+ 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: 8000 + Math.random() * 4000,
+ duration: 2000 + Math.random() * 1000,
easing: tween.linear
});
- // Scale pulsing for teal squares
- tween(tealSquare, {
- scaleX: tealSquare.scaleX * 1.5,
- scaleY: tealSquare.scaleY * 1.5
+ // Vertical pixel movement
+ tween(pixelBlock, {
+ y: pixelBlock.y + (Math.random() > 0.5 ? 60 : -60)
}, {
- duration: 3000 + Math.random() * 2000,
- easing: tween.easeInOut,
+ duration: 2500 + Math.random() * 1500,
+ easing: tween.linear,
onFinish: function () {
var elem = this;
tween(elem, {
- scaleX: elem.scaleX * 0.7,
- scaleY: elem.scaleY * 0.7
+ y: elem.initialY
}, {
- duration: 3000 + Math.random() * 2000,
- easing: tween.easeInOut
+ duration: 2500 + Math.random() * 1500,
+ easing: tween.linear
});
- }.bind(tealSquare)
+ }.bind(pixelBlock)
});
}
// Create money display
moneyDisplay = new Text2('💰 $0', {
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