User prompt
Has que el boss perro robot tenga un anti spam de su poder de 1 segundos de ataque para equilibrardo y que mejor tenga 1 de vida. También que el gato titán no sea afectado por sus rayos laser
User prompt
Perdón pero el gato titán no tiene la vida ni el daño y lo matan te dije que el gato titán tiene 17 de vida y 7 de daño, también agrega a un boss que aparezca después de derribar la base enemiga y que si lo matas ganes y el boss es: perro robot (55 vida)(0 daño)(lanza rayos laser que hacen 4 de daño)(no se mueve)(cuando lo matas ganas)
User prompt
Ok pero haz que el gato titán y gato defensa tenga su propio cuerpo y no sea una valiente del gato normal, y que el gato titán tenga 17 de vida y 6 de daño y que cueste 55 monedas.
User prompt
Ahora agrega que en la tienda halla el gato titán, y agrega un evento que ocurre cada 20 segundos que caiga un mamut en la base del enemigo para matarte
User prompt
Ahora has que el mamut tenga un 5% de aparecer y el cerdo un 35% de aparecer, la serpiente un 45% de aparecer, el pingüino un 23% de aparecer y el mamut un 5% de aparecer, también agrega al perro lanza papas que no aparece, también has un evento cuando aparezca el mamut donde los gatos que estaban cuando el mamut apareció no hagan daño y que tienen 1 de vida aunque sean muy fuertes, y los gatos después de 5 segundos se activan sus estadísticas normales, y agrega al gato titán (cuesta 55 moneras)(17 vida)(4.5 vida
User prompt
Has que el gato arquero, gato lechero y gato hachero tenga su propio cuerpo y que no sean variantes del gato normal, y has que el pingüino cuando lo matas te dé 35 monedas y el mamut te dé 50 moneras.
User prompt
Has que el gato lechero cueste 25 monedas, agrega al gato titán (15 vida)(5 daño)(cuesta 55), has que el cerdo tenga un 23% de aparecer, y que el meteorito que lanza el gato arquero haga 5 de daño, también agrega nuevos enemigos como: perro naza papas (el daño de las papas es de 1)(ataca desde una distancia corta)(1 vida)(26% más lento)(12% de aparecer), pingüino (12 vida)(3.5 daño)(10% más rápido)(25% de aparecer), mamut (20 vida)(7 daño)(aparece cada 120 monedas que el jugador gane)
User prompt
Has que cada vez que el gato arquero corra un 30% más lento y que se quede quieto cuando lanze las balas y después de acabar con el enemigo se vuelve a mover, agrega que cada 2 proyectiles halla un 90% que lanze un meteorito que hace 100 de daño y hace un daño en area
User prompt
Has que: perro 65% de aparecer, serpiente 30% de aparecer y cerdo 5% de aparecer
User prompt
Ahora agrega más gatos como: gato defensor curativo (5 vida)(2 daño)(19% más lento)(cuesta 25)(tienes un circulo alrededor de el que cura solo a los gatos) gato pistolero (1 vida)(3 daño)(tiene ataque a distancia y pueden lanzar balas y hacen 3 de daño pero dispara cada 1 segundos a los enemigos más cercanos)(cuesta 45) ga
User prompt
Pero pon para comprar los gatos en el centro que aparecen en la parte de la derecha y no se puede presionar mejor ponlo en el centro
User prompt
Pero no se ven para comprar gatos ponlos en el centro para comprar gatos pero siguen apareciendo en la base de gatos, también añade más gato como: gato lechero (25% más velocidad)(7 vida)(3 daño)(cuesta 60). También has que los gatos anterior cuesten: gato normal 15 monedas, gato defensor 25 y gato hachero 55
User prompt
Ahora has que cada 1 milisegundo gane 1 de dinero y que cada vez que mate aun enemigo genera 15+ de dinero pero no cambia el estado de generación, aparte pon que el gato normal cueste 50, gato defensor 100, y gato hachero 150. Y pon para comprar los gatos en el medio ↪💡 Consider importing and using the following plugins: @upit/storage.v1
Code edit (1 edits merged)
Please save this source code
User prompt
Cats vs Creatures: Tower Defense Battle
Initial prompt
un juego donde encuentra una plataforma y que encuentra una base a la izquierda de la pantalla y que en ella aparecen enemigos y que el jugador también tiene una base donde puede aparecer gatos para atacar a los enemigos que serán perros, serpientes y cerdos. Y que halla gravedad pero que los enemigos se vallan a la base y que no puedan saltar y los gatos de mi equipo también se tienen que ir a la base del enemigo para destruirla, y los gatos no pueden saltar y que los enemigos y gatos tengan colisión y que así se tengan que atacar para avanzar. Y que encuentra la tienda en el centro para comprar diferentes gatos que tienen más vida y ataque: gato normal (3 vida)(2 daño), gato muro (6 vida)(1 daño), gato hachero (5 vida)(3 vida). También los enemigos: perro (3 vida)(1.5 daño), serpiente (5%más lento) (5 vida)(2.5 daño), cerdo (10% más lento)(10 vida)(3.5 daño). También que tenga la vida arriba de su cabeza. También el piso tiene colisión y es de color verde de pasto, y un cielo que no tiene colisión
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
var storage = LK.import("@upit/storage.v1", {
playerResources: 0,
totalKills: 0
});
/****
* Classes
****/
// Base class
var Base = Container.expand(function () {
var self = Container.call(this);
var baseGraphics = self.attachAsset('playerBase', {
anchorX: 0.5,
anchorY: 1
});
var healthBar = self.addChild(new HealthBar());
healthBar.y = -180;
self.maxHealth = 200;
self.health = 200;
self.color = 0x4169E1;
self.takeDamage = function (dmg) {
self.health -= dmg;
healthBar.setHealth(self.health, self.maxHealth);
};
self.setColor = function (color) {
self.color = color;
baseGraphics.tint = color;
};
return self;
});
// Cat Unit Base Class
var CatUnit = Container.expand(function () {
var self = Container.call(this);
var catGraphics = self.attachAsset('catNormal', {
anchorX: 0.5,
anchorY: 0.5
});
var healthBar = self.addChild(new HealthBar());
healthBar.y = -50;
self.maxHealth = 30;
self.health = 30;
self.damage = 5;
self.speed = 2;
self.direction = -1; // -1 for left, 1 for right
self.gravity = 0.3;
self.velocityY = 0;
self.onGround = false;
self.groundLevel = 2732 - 100 - 40;
self.lastX = self.x;
self.takeDamage = function (dmg) {
self.health -= dmg;
healthBar.setHealth(self.health, self.maxHealth);
if (self.health <= 0) {
self.destroy();
return true;
}
return false;
};
self.update = function () {
self.lastX = self.x;
// Apply gravity
if (self.y < self.groundLevel) {
self.velocityY += self.gravity;
self.y += self.velocityY;
} else {
self.y = self.groundLevel;
self.velocityY = 0;
self.onGround = true;
}
// Move horizontally
self.x += self.speed * self.direction;
};
return self;
});
// Tank Cat
var CatTank = CatUnit.expand(function () {
var self = CatUnit.call(this);
self.attachAsset('catTank', {
anchorX: 0.5,
anchorY: 0.5
});
self.maxHealth = 60;
self.health = 60;
self.damage = 3;
self.speed = 1;
self.cost = 100;
return self;
});
// Normal Cat
var CatNormal = CatUnit.expand(function () {
var self = CatUnit.call(this);
var catGraphics = LK.getAsset('catNormal', {
anchorX: 0.5,
anchorY: 0.5
});
self.attachAsset('catNormal', {
anchorX: 0.5,
anchorY: 0.5
});
self.maxHealth = 30;
self.health = 30;
self.damage = 5;
self.speed = 2;
self.cost = 50;
return self;
});
// Axe Cat
var CatAxe = CatUnit.expand(function () {
var self = CatUnit.call(this);
self.attachAsset('catAxe', {
anchorX: 0.5,
anchorY: 0.5
});
self.maxHealth = 40;
self.health = 40;
self.damage = 10;
self.speed = 1.5;
self.cost = 150;
return self;
});
// Enemy Unit Base Class
var EnemyUnit = Container.expand(function () {
var self = Container.call(this);
var enemyGraphics = self.attachAsset('dog', {
anchorX: 0.5,
anchorY: 0.5
});
var healthBar = self.addChild(new HealthBar());
healthBar.y = -50;
self.maxHealth = 25;
self.health = 25;
self.damage = 4;
self.speed = 1.5;
self.direction = 1; // 1 for right
self.gravity = 0.3;
self.velocityY = 0;
self.onGround = false;
self.groundLevel = 2732 - 100 - 40;
self.lastX = self.x;
self.takeDamage = function (dmg) {
self.health -= dmg;
healthBar.setHealth(self.health, self.maxHealth);
if (self.health <= 0) {
self.destroy();
return true;
}
return false;
};
self.update = function () {
self.lastX = self.x;
// Apply gravity
if (self.y < self.groundLevel) {
self.velocityY += self.gravity;
self.y += self.velocityY;
} else {
self.y = self.groundLevel;
self.velocityY = 0;
self.onGround = true;
}
// Move horizontally
self.x += self.speed * self.direction;
};
return self;
});
// Snake Enemy
var Snake = EnemyUnit.expand(function () {
var self = EnemyUnit.call(this);
self.attachAsset('snake', {
anchorX: 0.5,
anchorY: 0.5
});
self.maxHealth = 35;
self.health = 35;
self.damage = 8;
self.speed = 1;
return self;
});
// Pig Enemy
var Pig = EnemyUnit.expand(function () {
var self = EnemyUnit.call(this);
self.attachAsset('pig', {
anchorX: 0.5,
anchorY: 0.5
});
self.maxHealth = 50;
self.health = 50;
self.damage = 6;
self.speed = 0.8;
return self;
});
// Dog Enemy
var Dog = EnemyUnit.expand(function () {
var self = EnemyUnit.call(this);
self.attachAsset('dog', {
anchorX: 0.5,
anchorY: 0.5
});
self.maxHealth = 25;
self.health = 25;
self.damage = 4;
self.speed = 1.5;
return self;
});
// Health Bar class
var HealthBar = Container.expand(function () {
var self = Container.call(this);
var maxHealth = 100;
var currentHealth = 100;
var background = LK.getAsset('background', {
width: 40,
height: 8,
color: 0x000000
});
var healthFill = LK.getAsset('healthFill', {
width: 40,
height: 8,
color: 0x00FF00
});
self.addChild(background);
self.addChild(healthFill);
self.setHealth = function (health, max) {
maxHealth = max;
currentHealth = health;
var percent = Math.max(0, currentHealth / maxHealth);
healthFill.width = 40 * percent;
if (percent > 0.5) {
healthFill.tint = 0x00FF00;
} else if (percent > 0.25) {
healthFill.tint = 0xFFFF00;
} else {
healthFill.tint = 0xFF0000;
}
};
return self;
});
// Shop Button
var ShopButton = Container.expand(function () {
var self = Container.call(this);
var buttonGraphics = self.attachAsset('shopButton', {
anchorX: 0.5,
anchorY: 0.5
});
var label = self.addChild(new Text2('SHOP', {
size: 24,
fill: 0x000000
}));
label.anchor.set(0.5, 0.5);
self.cost = 0;
self.unitType = 'normal';
self.down = function (x, y, obj) {
// Handle button press
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x87CEEB
});
/****
* Game Code
****/
// Sounds
// UI Elements
// Ground
// Bases
// Enemies
// Cats
// Add ground
var ground = game.addChild(LK.getAsset('ground', {
anchorX: 0,
anchorY: 1
}));
ground.x = 0;
ground.y = 2732;
// Create bases
var playerBase = game.addChild(new Base());
playerBase.x = 2048 - 100;
playerBase.y = 2732 - 100;
playerBase.setColor(0x4169E1);
var enemyBase = game.addChild(new Base());
enemyBase.x = 100;
enemyBase.y = 2732 - 100;
enemyBase.setColor(0xDC143C);
// Arrays for units
var catUnits = [];
var enemyUnits = [];
// Game state
var playerResources = storage.playerResources || 50;
var enemyResources = 50;
var gameOver = false;
var passiveMoneyPerTick = 0.016666; // 1 money per millisecond at 60 FPS
var accumulatedMoney = 0;
// UI - Resources display
var resourceText = new Text2('Resources: ' + Math.floor(playerResources), {
size: 60,
fill: 0x000000
});
resourceText.anchor.set(0.5, 0);
LK.gui.top.addChild(resourceText);
// Shop buttons - positioned at center
var normalCatButton = new Container();
normalCatButton.x = 1024 - 150;
normalCatButton.y = 150;
var normalButtonGraphics = normalCatButton.attachAsset('catNormal', {
anchorX: 0.5,
anchorY: 0.5
});
var normalCostText = normalCatButton.addChild(new Text2('50', {
size: 24,
fill: 0xFFFFFF
}));
normalCostText.anchor.set(0.5, 0.5);
normalCostText.y = 40;
normalCatButton.interactive = true;
normalCatButton.down = function (x, y, obj) {
if (playerResources >= 50) {
var newCat = game.addChild(new CatNormal());
newCat.x = playerBase.x - 100;
newCat.y = playerBase.y - 100;
newCat.direction = -1;
catUnits.push(newCat);
playerResources -= 50;
storage.playerResources = playerResources;
resourceText.setText('Resources: ' + Math.floor(playerResources));
LK.getSound('spawn').play();
}
};
normalCatButton.buttonMode = true;
LK.gui.top.addChild(normalCatButton);
var tankCatButton = new Container();
tankCatButton.x = 1024;
tankCatButton.y = 150;
var tankButtonGraphics = tankCatButton.attachAsset('catTank', {
anchorX: 0.5,
anchorY: 0.5
});
var tankCostText = tankCatButton.addChild(new Text2('100', {
size: 24,
fill: 0xFFFFFF
}));
tankCostText.anchor.set(0.5, 0.5);
tankCostText.y = 50;
tankCatButton.interactive = true;
tankCatButton.down = function (x, y, obj) {
if (playerResources >= 100) {
var newCat = game.addChild(new CatTank());
newCat.x = playerBase.x - 100;
newCat.y = playerBase.y - 100;
newCat.direction = -1;
catUnits.push(newCat);
playerResources -= 100;
storage.playerResources = playerResources;
resourceText.setText('Resources: ' + Math.floor(playerResources));
LK.getSound('spawn').play();
}
};
tankCatButton.buttonMode = true;
LK.gui.top.addChild(tankCatButton);
var axeCatButton = new Container();
axeCatButton.x = 1024 + 150;
axeCatButton.y = 150;
var axeButtonGraphics = axeCatButton.attachAsset('catAxe', {
anchorX: 0.5,
anchorY: 0.5
});
var axeCostText = axeCatButton.addChild(new Text2('150', {
size: 24,
fill: 0xFFFFFF
}));
axeCostText.anchor.set(0.5, 0.5);
axeCostText.y = 45;
axeCatButton.interactive = true;
axeCatButton.down = function (x, y, obj) {
if (playerResources >= 150) {
var newCat = game.addChild(new CatAxe());
newCat.x = playerBase.x - 100;
newCat.y = playerBase.y - 100;
newCat.direction = -1;
catUnits.push(newCat);
playerResources -= 150;
storage.playerResources = playerResources;
resourceText.setText('Resources: ' + Math.floor(playerResources));
LK.getSound('spawn').play();
}
};
axeCatButton.buttonMode = true;
LK.gui.top.addChild(axeCatButton);
// Enemy spawn timer
var enemySpawnTimer = LK.setInterval(function () {
if (gameOver) return;
if (enemyResources >= 10) {
var enemyType = Math.floor(Math.random() * 3);
var newEnemy;
if (enemyType === 0) {
newEnemy = new Dog();
enemyResources -= 10;
} else if (enemyType === 1) {
newEnemy = new Snake();
enemyResources -= 15;
} else {
newEnemy = new Pig();
enemyResources -= 20;
}
newEnemy = game.addChild(newEnemy);
newEnemy.x = enemyBase.x + 100;
newEnemy.y = enemyBase.y - 100;
newEnemy.direction = 1;
enemyUnits.push(newEnemy);
LK.getSound('spawn').play();
}
}, 2000);
// Main game update
game.update = function () {
if (gameOver) return;
// Passive money generation - 1 money per millisecond
accumulatedMoney += passiveMoneyPerTick;
if (accumulatedMoney >= 1) {
var moneyGained = Math.floor(accumulatedMoney);
playerResources += moneyGained;
accumulatedMoney -= moneyGained;
storage.playerResources = playerResources;
resourceText.setText('Resources: ' + Math.floor(playerResources));
}
// Enemy resource regeneration
enemyResources += 0.0333; // ~2 per second at 60 FPS
// Update all cat units
for (var i = catUnits.length - 1; i >= 0; i--) {
var cat = catUnits[i];
cat.update();
// Remove if off-screen
if (cat.x < -100 || cat.x > 2048 + 100 || cat.y > 2732 + 100) {
cat.destroy();
catUnits.splice(i, 1);
continue;
}
// Check collision with enemy base
if (cat.intersects(enemyBase)) {
enemyBase.takeDamage(cat.damage);
if (enemyBase.health <= 0) {
gameOver = true;
LK.showYouWin();
}
}
}
// Update all enemy units
for (var i = enemyUnits.length - 1; i >= 0; i--) {
var enemy = enemyUnits[i];
enemy.update();
// Remove if off-screen
if (enemy.x < -100 || enemy.x > 2048 + 100 || enemy.y > 2732 + 100) {
enemy.destroy();
enemyUnits.splice(i, 1);
continue;
}
// Check collision with player base
if (enemy.intersects(playerBase)) {
playerBase.takeDamage(enemy.damage);
if (playerBase.health <= 0) {
gameOver = true;
LK.showGameOver();
}
}
}
// Collision detection between cats and enemies
for (var i = 0; i < catUnits.length; i++) {
var cat = catUnits[i];
for (var j = enemyUnits.length - 1; j >= 0; j--) {
var enemy = enemyUnits[j];
if (cat.intersects(enemy)) {
LK.getSound('hit').play();
var enemyDied = enemy.takeDamage(cat.damage);
var catDied = cat.takeDamage(enemy.damage);
if (enemyDied) {
playerResources += 15;
storage.playerResources = playerResources;
resourceText.setText('Resources: ' + Math.floor(playerResources));
enemyUnits.splice(j, 1);
}
if (catDied) {
catUnits.splice(i, 1);
i--;
break;
}
}
}
}
}; ===================================================================
--- original.js
+++ change.js
@@ -1,8 +1,12 @@
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
+var storage = LK.import("@upit/storage.v1", {
+ playerResources: 0,
+ totalKills: 0
+});
/****
* Classes
****/
@@ -82,9 +86,9 @@
self.maxHealth = 60;
self.health = 60;
self.damage = 3;
self.speed = 1;
- self.cost = 20;
+ self.cost = 100;
return self;
});
// Normal Cat
var CatNormal = CatUnit.expand(function () {
@@ -100,9 +104,9 @@
self.maxHealth = 30;
self.health = 30;
self.damage = 5;
self.speed = 2;
- self.cost = 10;
+ self.cost = 50;
return self;
});
// Axe Cat
var CatAxe = CatUnit.expand(function () {
@@ -114,9 +118,9 @@
self.maxHealth = 40;
self.health = 40;
self.damage = 10;
self.speed = 1.5;
- self.cost = 25;
+ self.cost = 150;
return self;
});
// Enemy Unit Base Class
var EnemyUnit = Container.expand(function () {
@@ -288,104 +292,108 @@
// Arrays for units
var catUnits = [];
var enemyUnits = [];
// Game state
-var playerResources = 50;
+var playerResources = storage.playerResources || 50;
var enemyResources = 50;
var gameOver = false;
+var passiveMoneyPerTick = 0.016666; // 1 money per millisecond at 60 FPS
+var accumulatedMoney = 0;
// UI - Resources display
-var resourceText = new Text2('Resources: ' + playerResources, {
+var resourceText = new Text2('Resources: ' + Math.floor(playerResources), {
size: 60,
fill: 0x000000
});
-resourceText.anchor.set(0, 0);
+resourceText.anchor.set(0.5, 0);
LK.gui.top.addChild(resourceText);
-// Shop buttons
-var shopContainer = LK.gui.topLeft;
+// Shop buttons - positioned at center
var normalCatButton = new Container();
-normalCatButton.x = 50;
+normalCatButton.x = 1024 - 150;
normalCatButton.y = 150;
var normalButtonGraphics = normalCatButton.attachAsset('catNormal', {
anchorX: 0.5,
anchorY: 0.5
});
-var normalCostText = normalCatButton.addChild(new Text2('10', {
+var normalCostText = normalCatButton.addChild(new Text2('50', {
size: 24,
fill: 0xFFFFFF
}));
normalCostText.anchor.set(0.5, 0.5);
normalCostText.y = 40;
normalCatButton.interactive = true;
normalCatButton.down = function (x, y, obj) {
- if (playerResources >= 10) {
+ if (playerResources >= 50) {
var newCat = game.addChild(new CatNormal());
newCat.x = playerBase.x - 100;
newCat.y = playerBase.y - 100;
newCat.direction = -1;
catUnits.push(newCat);
- playerResources -= 10;
- resourceText.setText('Resources: ' + playerResources);
+ playerResources -= 50;
+ storage.playerResources = playerResources;
+ resourceText.setText('Resources: ' + Math.floor(playerResources));
LK.getSound('spawn').play();
}
};
normalCatButton.buttonMode = true;
-LK.gui.topLeft.addChild(normalCatButton);
+LK.gui.top.addChild(normalCatButton);
var tankCatButton = new Container();
-tankCatButton.x = 50;
-tankCatButton.y = 270;
+tankCatButton.x = 1024;
+tankCatButton.y = 150;
var tankButtonGraphics = tankCatButton.attachAsset('catTank', {
anchorX: 0.5,
anchorY: 0.5
});
-var tankCostText = tankCatButton.addChild(new Text2('20', {
+var tankCostText = tankCatButton.addChild(new Text2('100', {
size: 24,
fill: 0xFFFFFF
}));
tankCostText.anchor.set(0.5, 0.5);
tankCostText.y = 50;
tankCatButton.interactive = true;
tankCatButton.down = function (x, y, obj) {
- if (playerResources >= 20) {
+ if (playerResources >= 100) {
var newCat = game.addChild(new CatTank());
newCat.x = playerBase.x - 100;
newCat.y = playerBase.y - 100;
newCat.direction = -1;
catUnits.push(newCat);
- playerResources -= 20;
- resourceText.setText('Resources: ' + playerResources);
+ playerResources -= 100;
+ storage.playerResources = playerResources;
+ resourceText.setText('Resources: ' + Math.floor(playerResources));
LK.getSound('spawn').play();
}
};
tankCatButton.buttonMode = true;
-LK.gui.topLeft.addChild(tankCatButton);
+LK.gui.top.addChild(tankCatButton);
var axeCatButton = new Container();
-axeCatButton.x = 50;
-axeCatButton.y = 390;
+axeCatButton.x = 1024 + 150;
+axeCatButton.y = 150;
var axeButtonGraphics = axeCatButton.attachAsset('catAxe', {
anchorX: 0.5,
anchorY: 0.5
});
-var axeCostText = axeCatButton.addChild(new Text2('25', {
+var axeCostText = axeCatButton.addChild(new Text2('150', {
size: 24,
fill: 0xFFFFFF
}));
axeCostText.anchor.set(0.5, 0.5);
axeCostText.y = 45;
axeCatButton.interactive = true;
axeCatButton.down = function (x, y, obj) {
- if (playerResources >= 25) {
+ if (playerResources >= 150) {
var newCat = game.addChild(new CatAxe());
newCat.x = playerBase.x - 100;
newCat.y = playerBase.y - 100;
newCat.direction = -1;
catUnits.push(newCat);
- playerResources -= 25;
- resourceText.setText('Resources: ' + playerResources);
+ playerResources -= 150;
+ storage.playerResources = playerResources;
+ resourceText.setText('Resources: ' + Math.floor(playerResources));
LK.getSound('spawn').play();
}
};
axeCatButton.buttonMode = true;
-LK.gui.topLeft.addChild(axeCatButton);
+LK.gui.top.addChild(axeCatButton);
// Enemy spawn timer
var enemySpawnTimer = LK.setInterval(function () {
if (gameOver) return;
if (enemyResources >= 10) {
@@ -408,19 +416,22 @@
enemyUnits.push(newEnemy);
LK.getSound('spawn').play();
}
}, 2000);
-// Resource regeneration
-var resourceRegenTimer = LK.setInterval(function () {
- if (!gameOver) {
- playerResources += 2;
- enemyResources += 2;
- resourceText.setText('Resources: ' + playerResources);
- }
-}, 3000);
// Main game update
game.update = function () {
if (gameOver) return;
+ // Passive money generation - 1 money per millisecond
+ accumulatedMoney += passiveMoneyPerTick;
+ if (accumulatedMoney >= 1) {
+ var moneyGained = Math.floor(accumulatedMoney);
+ playerResources += moneyGained;
+ accumulatedMoney -= moneyGained;
+ storage.playerResources = playerResources;
+ resourceText.setText('Resources: ' + Math.floor(playerResources));
+ }
+ // Enemy resource regeneration
+ enemyResources += 0.0333; // ~2 per second at 60 FPS
// Update all cat units
for (var i = catUnits.length - 1; i >= 0; i--) {
var cat = catUnits[i];
cat.update();
@@ -467,10 +478,11 @@
LK.getSound('hit').play();
var enemyDied = enemy.takeDamage(cat.damage);
var catDied = cat.takeDamage(enemy.damage);
if (enemyDied) {
- playerResources += 5;
- resourceText.setText('Resources: ' + playerResources);
+ playerResources += 15;
+ storage.playerResources = playerResources;
+ resourceText.setText('Resources: ' + Math.floor(playerResources));
enemyUnits.splice(j, 1);
}
if (catDied) {
catUnits.splice(i, 1);
Un gato blanco con ojos y boca negra sin cuerpo solo la cabeza circular con sus orejas y sus 4 patitas estilo caricatura. In-Game asset. 2d. High contrast. No shadows
Has que el gato tenga un hacha en una mano
El gato sosteniendo una pistola con munición en una patita
Un gato con forma de vaca con 2 cuernos blanco como su cuerpo pero con un ojos y boca negros estilo caricatura. In-Game asset. 2d. High contrast. No shadows
Un perro blanco con 2 patas y dientes de vampiro con una cola pelula estilo caricatura. In-Game asset. 2d. High contrast. No shadows
Una serpiente blanca con manchas grises con ojos negros estilo caricatura. In-Game asset. 2d. High contrast. No shadows
Un cerdo blanco con cuernos en su nariz con ojos negros estilo caricatura. In-Game asset. 2d. High contrast. No shadows
Hasdo en 2 patas y musculoso