User prompt
Los botones principales siguen estando muy pegados separa los más y los iconos del inventario más grandes aun también vamos añadir iconos a la barra hambre, Diversión y fatiga.
User prompt
También has los iconos del inventario más grandes además algunos botones estan muy pegados como el de entranamiento y se sobre ponen con otros
User prompt
Deberíamos hacer los botones un poco más grandes y el texto también sobra mucho espacio y además la barra de diversión y hambre deben bajar más lento por si solas
User prompt
La barra de hambre no baja por si sola y la barra de diversión baja lentamente, la barra de dormir se cambia a fatiga y esta sube solo cuando entrena, falta añadir un icono encima del Digimon que indique si esta lesionado o enfermo. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
La barra de hambre solo bajara un poco cuando entrenes y juegues con el Digimon además el botón de alimentar lo vamos a quitar y en su lugar añadiremos un inventario abajo de los botones principales en ese inventario en cada nueva partida y solo en estas, el jugador recibirá 10 carnes pequeñas 5 benditas y 3 medicinas, el digimon puede lastimarse si lo entrenas con cansancio y si no le das una bendita esto empeora y se enferma si no le das la medicina se muere y comienzas de nuevo también el digimon muere si la barra de hambre llega a cero y no lo alimentas en 5 minutos, el tiempo de lesión a enfermedad es de 30 minutos, las carnes que existen son, Carne Pequeña, Carne Mediana, Carne Grande, Solomillo. ↪💡 Consider importing and using the following plugins: @upit/storage.v1, @upit/tween.v1
User prompt
Hay que añadir un fondo
User prompt
Please fix the bug: 'Uncaught TypeError: self.updateAppearance is not a function' in or related to this line: 'self.updateAppearance();' Line Number: 159
User prompt
Puedes añadir los assets que faltan de todo eso y por favor arregla bien el teclado digital el espacio y borrar se sobre ponen en otras letras
User prompt
Muy bien falta que los Digimon tengan diferentes apariencia y cada uno evolucione según los parámetros de nivel, ataque, vida, velocidad, peso y ratio de victorias, todas esas estadísticas deberían ser visibles al pulsar el Digimon y por cierto quiero que el jugar es el que ponga el nombre del Digimon con un límite de 7 Caracteres. ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
Please fix the bug: 'Script error.' in or related to this line: 'storage.savedGames = savedGames;' Line Number: 893 ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
Please fix the bug: 'Uncaught TypeError: storage.get is not a function' in or related to this line: 'var savedGames = storage.get('savedGames') || [];' Line Number: 833 ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
Please fix the bug: 'Script error.' in or related to this line: 'storage.savedGames = savedGames;' Line Number: 893
User prompt
Faltaron varias cosas de las que te pedi por favor ↪💡 Consider importing and using the following plugins: @upit/storage.v1, @upit/tween.v1
User prompt
Muy bien pero deberíamos añadir un menu principal donde diga nuevo juego y también ver las partidas guardadas, cuando iniciemos un juego nuevo nos pedirá el nombre del Digimon y escogeremos uno de los 3 digi huevos coloca otros 3 con un candado que se desbloquearan cuando los hayamos comprado dentro del juego o completado una misión tendremos que añadir dinero y una tienda, el dinero se conseguirá jugando con el Digimon o en combates, será necesario implementar un sistema de entrenamiento de ataque, vida y velocidad la defensa se calculará según el peso del Digimon y este se sabrá por la cantidad de comida digerida el entrenamiento bajara un poquito el peso cada vez y la comida lo subirá, añadiremos diferentes comidas con efectos únicos también debemos tener música en la tienda, en el menú principal y en el menú de entrenamiento, el entrenamiento y jugar nos dará experiencia la cual aumentará el nivel de evolución cada Digimon tendrá 5 evoluciones. Más adelante profundizaremos la mecánica de combate rítmica junto con sus tipos y elementos. ↪💡 Consider importing and using the following plugins: @upit/storage.v1, @upit/tween.v1
User prompt
Please fix the bug: 'Cannot read properties of undefined (reading 'setText')' in or related to this line: 'evolutionText.setText(getText('evolutionLevel') + ': ' + pet.evolutionLevel);' Line Number: 412
User prompt
Please fix the bug: 'hungerBar.children[1].setText is not a function' in or related to this line: 'return languages[currentLanguage][key] || key;' Line Number: 400
User prompt
Please fix the bug: 'Cannot read properties of undefined (reading 'setText')' in or related to this line: 'evolutionText.setText(getText('evolutionLevel') + ': ' + pet.evolutionLevel);' Line Number: 415
User prompt
Please fix the bug: 'hungerBar.children[1].setText is not a function' in or related to this line: 'return languages[currentLanguage][key] || key;' Line Number: 400
User prompt
Si y le pones un icono de bandera según el idioma ↪💡 Consider importing and using the following plugins: @upit/storage.v1
Code edit (1 edits merged)
Please save this source code
User prompt
Digi Pet Evolution
Initial prompt
Hola Ava mucho gusto quisiera crear un juego inspirado en los tamagoshi de Digimon
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); var storage = LK.import("@upit/storage.v1"); /**** * Classes ****/ var ActionButton = Container.expand(function (text, color) { var self = Container.call(this); var buttonBg = self.attachAsset('button', { anchorX: 0.5, anchorY: 0.5, tint: color }); var buttonText = new Text2(text, { size: 30, fill: 0xFFFFFF }); buttonText.anchor.set(0.5, 0.5); self.addChild(buttonText); self.down = function (x, y, obj) { tween(self, { scaleX: 0.9, scaleY: 0.9 }, { duration: 100 }); }; self.up = function (x, y, obj) { tween(self, { scaleX: 1, scaleY: 1 }, { duration: 100 }); if (self.onPress) { self.onPress(); } }; return self; }); var DigitalPet = Container.expand(function () { var self = Container.call(this); // Pet graphics var body = self.attachAsset('petBody', { anchorX: 0.5, anchorY: 0.5 }); var leftEye = self.attachAsset('petEye', { anchorX: 0.5, anchorY: 0.5, x: -40, y: -30 }); var rightEye = self.attachAsset('petEye', { anchorX: 0.5, anchorY: 0.5, x: 40, y: -30 }); // Pet stats self.hunger = storage.hunger || 100; self.happiness = storage.happiness || 100; self.energy = storage.energy || 100; self.evolutionLevel = storage.evolutionLevel || 0; self.lastUpdateTime = Date.now(); // Evolution colors self.evolutionColors = [0x4CAF50, 0x2196F3, 0xFF9800, 0x9C27B0, 0xF44336]; self.updateAppearance = function () { var color = self.evolutionColors[self.evolutionLevel] || 0x4CAF50; body.tint = color; // Scale based on evolution level var scale = 1 + self.evolutionLevel * 0.2; body.scaleX = scale; body.scaleY = scale; // Eye expressions based on happiness if (self.happiness > 70) { leftEye.scaleY = 1; rightEye.scaleY = 1; } else if (self.happiness > 30) { leftEye.scaleY = 0.8; rightEye.scaleY = 0.8; } else { leftEye.scaleY = 0.5; rightEye.scaleY = 0.5; } }; self.evolveCheck = function () { var avgStat = (self.hunger + self.happiness + self.energy) / 3; var targetLevel = Math.floor(avgStat / 25); if (targetLevel > self.evolutionLevel && targetLevel < self.evolutionColors.length) { self.evolutionLevel = targetLevel; LK.getSound('evolve').play(); // Evolution animation tween(self, { scaleX: 1.5, scaleY: 1.5 }, { duration: 500, easing: tween.bounceOut, onFinish: function onFinish() { tween(self, { scaleX: 1, scaleY: 1 }, { duration: 300, easing: tween.easeOut }); } }); self.updateAppearance(); LK.effects.flashScreen(0xFFD700, 1000); } }; self.update = function () { var currentTime = Date.now(); var deltaTime = (currentTime - self.lastUpdateTime) / 1000; self.lastUpdateTime = currentTime; // Decay stats over time self.hunger = Math.max(0, self.hunger - deltaTime * 2); self.happiness = Math.max(0, self.happiness - deltaTime * 1.5); self.energy = Math.max(0, self.energy - deltaTime * 1); // Idle animation if (LK.ticks % 120 === 0) { tween(self, { y: self.y - 20 }, { duration: 500, easing: tween.easeInOut, onFinish: function onFinish() { tween(self, { y: self.y + 20 }, { duration: 500, easing: tween.easeInOut }); } }); } self.updateAppearance(); self.evolveCheck(); // Save stats storage.hunger = self.hunger; storage.happiness = self.happiness; storage.energy = self.energy; storage.evolutionLevel = self.evolutionLevel; }; return self; }); var MiniGame = Container.expand(function () { var self = Container.call(this); var gameArea = self.attachAsset('gameArea', { anchorX: 0.5, anchorY: 0.5 }); var target = self.attachAsset('target', { anchorX: 0.5, anchorY: 0.5 }); self.score = 0; self.timeLeft = 10; self.gameActive = false; var scoreText = new Text2('Score: 0', { size: 30, fill: 0x333333 }); scoreText.anchor.set(0.5, 0); scoreText.y = -180; self.addChild(scoreText); var timerText = new Text2('Time: 10', { size: 30, fill: 0x333333 }); timerText.anchor.set(0.5, 0); timerText.y = -140; self.addChild(timerText); self.startGame = function () { self.gameActive = true; self.score = 0; self.timeLeft = 10; self.moveTarget(); var gameTimer = LK.setInterval(function () { self.timeLeft -= 0.1; timerText.setText('Time: ' + Math.ceil(self.timeLeft)); if (self.timeLeft <= 0) { LK.clearInterval(gameTimer); self.endGame(); } }, 100); }; self.moveTarget = function () { if (!self.gameActive) return; var newX = (Math.random() - 0.5) * 300; var newY = (Math.random() - 0.5) * 300; tween(target, { x: newX, y: newY }, { duration: 200, easing: tween.easeOut }); }; self.endGame = function () { self.gameActive = false; var happiness = Math.min(20, self.score * 2); pet.happiness = Math.min(100, pet.happiness + happiness); pet.energy = Math.max(0, pet.energy - 15); if (self.onGameEnd) { self.onGameEnd(self.score); } }; target.down = function (x, y, obj) { if (!self.gameActive) return; self.score++; scoreText.setText('Score: ' + self.score); LK.getSound('play').play(); tween(target, { scaleX: 1.3, scaleY: 1.3 }, { duration: 100, onFinish: function onFinish() { tween(target, { scaleX: 1, scaleY: 1 }, { duration: 100 }); } }); self.moveTarget(); }; return self; }); var StatBar = Container.expand(function (label, color) { var self = Container.call(this); var background = self.attachAsset('statBar', { anchorX: 0, anchorY: 0.5 }); var fill = self.attachAsset('statFill', { anchorX: 0, anchorY: 0.5, tint: color, scaleX: 1 }); var labelText = new Text2(label, { size: 25, fill: 0x333333 }); labelText.anchor.set(0, 0.5); labelText.x = -80; self.addChild(labelText); self.updateValue = function (value) { var percentage = Math.max(0, Math.min(100, value)) / 100; tween(fill, { scaleX: percentage }, { duration: 300, easing: tween.easeOut }); }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0xE8F5E8 }); /**** * Game Code ****/ var pet = game.addChild(new DigitalPet()); pet.x = 1024; pet.y = 800; // UI Elements var hungerBar = new StatBar('Hunger', 0xFF5722); hungerBar.x = 400; hungerBar.y = 200; game.addChild(hungerBar); var happinessBar = new StatBar('Happy', 0xFFEB3B); happinessBar.x = 400; happinessBar.y = 280; game.addChild(happinessBar); var energyBar = new StatBar('Energy', 0x2196F3); energyBar.x = 400; energyBar.y = 360; game.addChild(energyBar); // Action Buttons var feedButton = new ActionButton('Feed', 0x4CAF50); feedButton.x = 300; feedButton.y = 500; feedButton.onPress = function () { pet.hunger = Math.min(100, pet.hunger + 25); pet.happiness = Math.min(100, pet.happiness + 10); LK.getSound('feed').play(); tween(pet, { scaleX: 1.2, scaleY: 1.2 }, { duration: 200, onFinish: function onFinish() { tween(pet, { scaleX: 1, scaleY: 1 }, { duration: 200 }); } }); }; game.addChild(feedButton); var playButton = new ActionButton('Play', 0xFF9800); playButton.x = 600; playButton.y = 500; playButton.onPress = function () { if (pet.energy < 20) { LK.effects.flashObject(pet, 0xFF0000, 500); return; } var miniGame = new MiniGame(); miniGame.x = 1024; miniGame.y = 1200; game.addChild(miniGame); miniGame.onGameEnd = function (score) { game.removeChild(miniGame); }; miniGame.startGame(); }; game.addChild(playButton); var sleepButton = new ActionButton('Sleep', 0x9C27B0); sleepButton.x = 900; sleepButton.y = 500; sleepButton.onPress = function () { pet.energy = Math.min(100, pet.energy + 30); pet.hunger = Math.max(0, pet.hunger - 5); LK.getSound('sleep').play(); tween(pet, { alpha: 0.5 }, { duration: 500, onFinish: function onFinish() { tween(pet, { alpha: 1 }, { duration: 500 }); } }); }; game.addChild(sleepButton); // Evolution display var evolutionText = new Text2('Evolution Level: 0', { size: 40, fill: 0x333333 }); evolutionText.anchor.set(0.5, 0); evolutionText.x = 1024; evolutionText.y = 600; game.addChild(evolutionText); game.update = function () { // Update stat bars hungerBar.updateValue(pet.hunger); happinessBar.updateValue(pet.happiness); energyBar.updateValue(pet.energy); // Update evolution display evolutionText.setText('Evolution Level: ' + pet.evolutionLevel); // Warning effects for low stats if (pet.hunger < 20 && LK.ticks % 60 === 0) { LK.effects.flashObject(hungerBar, 0xFF0000, 300); } if (pet.happiness < 20 && LK.ticks % 60 === 0) { LK.effects.flashObject(happinessBar, 0xFF0000, 300); } if (pet.energy < 20 && LK.ticks % 60 === 0) { LK.effects.flashObject(energyBar, 0xFF0000, 300); } };
===================================================================
--- original.js
+++ change.js
@@ -1,6 +1,383 @@
-/****
+/****
+* Plugins
+****/
+var tween = LK.import("@upit/tween.v1");
+var storage = LK.import("@upit/storage.v1");
+
+/****
+* Classes
+****/
+var ActionButton = Container.expand(function (text, color) {
+ var self = Container.call(this);
+ var buttonBg = self.attachAsset('button', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ tint: color
+ });
+ var buttonText = new Text2(text, {
+ size: 30,
+ fill: 0xFFFFFF
+ });
+ buttonText.anchor.set(0.5, 0.5);
+ self.addChild(buttonText);
+ self.down = function (x, y, obj) {
+ tween(self, {
+ scaleX: 0.9,
+ scaleY: 0.9
+ }, {
+ duration: 100
+ });
+ };
+ self.up = function (x, y, obj) {
+ tween(self, {
+ scaleX: 1,
+ scaleY: 1
+ }, {
+ duration: 100
+ });
+ if (self.onPress) {
+ self.onPress();
+ }
+ };
+ return self;
+});
+var DigitalPet = Container.expand(function () {
+ var self = Container.call(this);
+ // Pet graphics
+ var body = self.attachAsset('petBody', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ var leftEye = self.attachAsset('petEye', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: -40,
+ y: -30
+ });
+ var rightEye = self.attachAsset('petEye', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 40,
+ y: -30
+ });
+ // Pet stats
+ self.hunger = storage.hunger || 100;
+ self.happiness = storage.happiness || 100;
+ self.energy = storage.energy || 100;
+ self.evolutionLevel = storage.evolutionLevel || 0;
+ self.lastUpdateTime = Date.now();
+ // Evolution colors
+ self.evolutionColors = [0x4CAF50, 0x2196F3, 0xFF9800, 0x9C27B0, 0xF44336];
+ self.updateAppearance = function () {
+ var color = self.evolutionColors[self.evolutionLevel] || 0x4CAF50;
+ body.tint = color;
+ // Scale based on evolution level
+ var scale = 1 + self.evolutionLevel * 0.2;
+ body.scaleX = scale;
+ body.scaleY = scale;
+ // Eye expressions based on happiness
+ if (self.happiness > 70) {
+ leftEye.scaleY = 1;
+ rightEye.scaleY = 1;
+ } else if (self.happiness > 30) {
+ leftEye.scaleY = 0.8;
+ rightEye.scaleY = 0.8;
+ } else {
+ leftEye.scaleY = 0.5;
+ rightEye.scaleY = 0.5;
+ }
+ };
+ self.evolveCheck = function () {
+ var avgStat = (self.hunger + self.happiness + self.energy) / 3;
+ var targetLevel = Math.floor(avgStat / 25);
+ if (targetLevel > self.evolutionLevel && targetLevel < self.evolutionColors.length) {
+ self.evolutionLevel = targetLevel;
+ LK.getSound('evolve').play();
+ // Evolution animation
+ tween(self, {
+ scaleX: 1.5,
+ scaleY: 1.5
+ }, {
+ duration: 500,
+ easing: tween.bounceOut,
+ onFinish: function onFinish() {
+ tween(self, {
+ scaleX: 1,
+ scaleY: 1
+ }, {
+ duration: 300,
+ easing: tween.easeOut
+ });
+ }
+ });
+ self.updateAppearance();
+ LK.effects.flashScreen(0xFFD700, 1000);
+ }
+ };
+ self.update = function () {
+ var currentTime = Date.now();
+ var deltaTime = (currentTime - self.lastUpdateTime) / 1000;
+ self.lastUpdateTime = currentTime;
+ // Decay stats over time
+ self.hunger = Math.max(0, self.hunger - deltaTime * 2);
+ self.happiness = Math.max(0, self.happiness - deltaTime * 1.5);
+ self.energy = Math.max(0, self.energy - deltaTime * 1);
+ // Idle animation
+ if (LK.ticks % 120 === 0) {
+ tween(self, {
+ y: self.y - 20
+ }, {
+ duration: 500,
+ easing: tween.easeInOut,
+ onFinish: function onFinish() {
+ tween(self, {
+ y: self.y + 20
+ }, {
+ duration: 500,
+ easing: tween.easeInOut
+ });
+ }
+ });
+ }
+ self.updateAppearance();
+ self.evolveCheck();
+ // Save stats
+ storage.hunger = self.hunger;
+ storage.happiness = self.happiness;
+ storage.energy = self.energy;
+ storage.evolutionLevel = self.evolutionLevel;
+ };
+ return self;
+});
+var MiniGame = Container.expand(function () {
+ var self = Container.call(this);
+ var gameArea = self.attachAsset('gameArea', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ var target = self.attachAsset('target', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.score = 0;
+ self.timeLeft = 10;
+ self.gameActive = false;
+ var scoreText = new Text2('Score: 0', {
+ size: 30,
+ fill: 0x333333
+ });
+ scoreText.anchor.set(0.5, 0);
+ scoreText.y = -180;
+ self.addChild(scoreText);
+ var timerText = new Text2('Time: 10', {
+ size: 30,
+ fill: 0x333333
+ });
+ timerText.anchor.set(0.5, 0);
+ timerText.y = -140;
+ self.addChild(timerText);
+ self.startGame = function () {
+ self.gameActive = true;
+ self.score = 0;
+ self.timeLeft = 10;
+ self.moveTarget();
+ var gameTimer = LK.setInterval(function () {
+ self.timeLeft -= 0.1;
+ timerText.setText('Time: ' + Math.ceil(self.timeLeft));
+ if (self.timeLeft <= 0) {
+ LK.clearInterval(gameTimer);
+ self.endGame();
+ }
+ }, 100);
+ };
+ self.moveTarget = function () {
+ if (!self.gameActive) return;
+ var newX = (Math.random() - 0.5) * 300;
+ var newY = (Math.random() - 0.5) * 300;
+ tween(target, {
+ x: newX,
+ y: newY
+ }, {
+ duration: 200,
+ easing: tween.easeOut
+ });
+ };
+ self.endGame = function () {
+ self.gameActive = false;
+ var happiness = Math.min(20, self.score * 2);
+ pet.happiness = Math.min(100, pet.happiness + happiness);
+ pet.energy = Math.max(0, pet.energy - 15);
+ if (self.onGameEnd) {
+ self.onGameEnd(self.score);
+ }
+ };
+ target.down = function (x, y, obj) {
+ if (!self.gameActive) return;
+ self.score++;
+ scoreText.setText('Score: ' + self.score);
+ LK.getSound('play').play();
+ tween(target, {
+ scaleX: 1.3,
+ scaleY: 1.3
+ }, {
+ duration: 100,
+ onFinish: function onFinish() {
+ tween(target, {
+ scaleX: 1,
+ scaleY: 1
+ }, {
+ duration: 100
+ });
+ }
+ });
+ self.moveTarget();
+ };
+ return self;
+});
+var StatBar = Container.expand(function (label, color) {
+ var self = Container.call(this);
+ var background = self.attachAsset('statBar', {
+ anchorX: 0,
+ anchorY: 0.5
+ });
+ var fill = self.attachAsset('statFill', {
+ anchorX: 0,
+ anchorY: 0.5,
+ tint: color,
+ scaleX: 1
+ });
+ var labelText = new Text2(label, {
+ size: 25,
+ fill: 0x333333
+ });
+ labelText.anchor.set(0, 0.5);
+ labelText.x = -80;
+ self.addChild(labelText);
+ self.updateValue = function (value) {
+ var percentage = Math.max(0, Math.min(100, value)) / 100;
+ tween(fill, {
+ scaleX: percentage
+ }, {
+ duration: 300,
+ easing: tween.easeOut
+ });
+ };
+ return self;
+});
+
+/****
* Initialize Game
-****/
+****/
var game = new LK.Game({
- backgroundColor: 0x000000
-});
\ No newline at end of file
+ backgroundColor: 0xE8F5E8
+});
+
+/****
+* Game Code
+****/
+var pet = game.addChild(new DigitalPet());
+pet.x = 1024;
+pet.y = 800;
+// UI Elements
+var hungerBar = new StatBar('Hunger', 0xFF5722);
+hungerBar.x = 400;
+hungerBar.y = 200;
+game.addChild(hungerBar);
+var happinessBar = new StatBar('Happy', 0xFFEB3B);
+happinessBar.x = 400;
+happinessBar.y = 280;
+game.addChild(happinessBar);
+var energyBar = new StatBar('Energy', 0x2196F3);
+energyBar.x = 400;
+energyBar.y = 360;
+game.addChild(energyBar);
+// Action Buttons
+var feedButton = new ActionButton('Feed', 0x4CAF50);
+feedButton.x = 300;
+feedButton.y = 500;
+feedButton.onPress = function () {
+ pet.hunger = Math.min(100, pet.hunger + 25);
+ pet.happiness = Math.min(100, pet.happiness + 10);
+ LK.getSound('feed').play();
+ tween(pet, {
+ scaleX: 1.2,
+ scaleY: 1.2
+ }, {
+ duration: 200,
+ onFinish: function onFinish() {
+ tween(pet, {
+ scaleX: 1,
+ scaleY: 1
+ }, {
+ duration: 200
+ });
+ }
+ });
+};
+game.addChild(feedButton);
+var playButton = new ActionButton('Play', 0xFF9800);
+playButton.x = 600;
+playButton.y = 500;
+playButton.onPress = function () {
+ if (pet.energy < 20) {
+ LK.effects.flashObject(pet, 0xFF0000, 500);
+ return;
+ }
+ var miniGame = new MiniGame();
+ miniGame.x = 1024;
+ miniGame.y = 1200;
+ game.addChild(miniGame);
+ miniGame.onGameEnd = function (score) {
+ game.removeChild(miniGame);
+ };
+ miniGame.startGame();
+};
+game.addChild(playButton);
+var sleepButton = new ActionButton('Sleep', 0x9C27B0);
+sleepButton.x = 900;
+sleepButton.y = 500;
+sleepButton.onPress = function () {
+ pet.energy = Math.min(100, pet.energy + 30);
+ pet.hunger = Math.max(0, pet.hunger - 5);
+ LK.getSound('sleep').play();
+ tween(pet, {
+ alpha: 0.5
+ }, {
+ duration: 500,
+ onFinish: function onFinish() {
+ tween(pet, {
+ alpha: 1
+ }, {
+ duration: 500
+ });
+ }
+ });
+};
+game.addChild(sleepButton);
+// Evolution display
+var evolutionText = new Text2('Evolution Level: 0', {
+ size: 40,
+ fill: 0x333333
+});
+evolutionText.anchor.set(0.5, 0);
+evolutionText.x = 1024;
+evolutionText.y = 600;
+game.addChild(evolutionText);
+game.update = function () {
+ // Update stat bars
+ hungerBar.updateValue(pet.hunger);
+ happinessBar.updateValue(pet.happiness);
+ energyBar.updateValue(pet.energy);
+ // Update evolution display
+ evolutionText.setText('Evolution Level: ' + pet.evolutionLevel);
+ // Warning effects for low stats
+ if (pet.hunger < 20 && LK.ticks % 60 === 0) {
+ LK.effects.flashObject(hungerBar, 0xFF0000, 300);
+ }
+ if (pet.happiness < 20 && LK.ticks % 60 === 0) {
+ LK.effects.flashObject(happinessBar, 0xFF0000, 300);
+ }
+ if (pet.energy < 20 && LK.ticks % 60 === 0) {
+ LK.effects.flashObject(energyBar, 0xFF0000, 300);
+ }
+};
\ No newline at end of file
Bandera de idioma español. In-Game asset. 2d. High contrast. No shadows
Bandera de Idioma inglés curvada con sus primeras letras EN. In-Game asset. 2d. High contrast. No shadows
Planeta tierra con un libro. In-Game asset. 2d. High contrast. No shadows
Pelusa roja de ojos amarillos tierno. In-Game asset. 2d. High contrast. No shadows
Marco de menu con relleno sin ningun texto. In-Game asset. 2d. High contrast. No shadows
Fondo de ambiente digital con azul y verde. In-Game asset. 2d. High contrast. No shadows
Carne pequeña. In-Game asset. 2d. High contrast. No shadows
Carne Grande. In-Game asset. 2d. High contrast. No shadows
Sirloin. In-Game asset. 2d. High contrast. No shadows
Medicina. In-Game asset. 2d. High contrast. No shadows
Benda. In-Game asset. 2d. High contrast. No shadows
Agumon. In-Game asset. 2d. High contrast. No shadows
barra llena. In-Game asset. 2d. High contrast. No shadows
boton sin texto. In-Game asset. 2d. High contrast. No shadows
zzZZZ. In-Game asset. 2d. High contrast. No shadows
Greymon. In-Game asset. 2d. High contrast. No shadows
Wargreymon. In-Game asset. 2d. High contrast. No shadows
Metalgreymon. In-Game asset. 2d. High contrast. No shadows
Omegamon. In-Game asset. 2d. High contrast. No shadows
Cara Koromon feliz. In-Game asset. 2d. High contrast. No shadows
Botamon. In-Game asset. 2d. High contrast. No shadows
Angemon. In-Game asset. 2d. High contrast. No shadows
Angewomon. In-Game asset. 2d. High contrast. No shadows
Gabumon. In-Game asset. 2d. High contrast. No shadows
Garurumon. In-Game asset. 2d. High contrast. No shadows
Magnaangemon. In-Game asset. 2d. High contrast. No shadows
magnadramon. In-Game asset. 2d. High contrast. No shadows
Metalgarurumon. In-Game asset. 2d. High contrast. No shadows
Ophanimon blue armor complete body sensual. In-Game asset. 2d. High contrast. No shadows
Poyomon. In-Game asset. 2d. High contrast. No shadows
Patamon. In-Game asset. 2d. High contrast. No shadows
Punimon. In-Game asset. 2d. High contrast. No shadows
Seraphimon. In-Game asset. 2d. High contrast. No shadows
Tokomon. In-Game asset. 2d. High contrast. No shadows
Tsunomon. In-Game asset. 2d. High contrast. No shadows
Weregarurumon. In-Game asset. 2d. High contrast. No shadows
Digi huevo de botamon. In-Game asset. 2d. High contrast. No shadows
Digi huevo con el patron clasico de Punimon. In-Game asset. 2d. High contrast. No shadows
Digi huevo con el patron clasico de Puyomon. In-Game asset. 2d. High contrast. No shadows
Moneda ojo monstruo. In-Game asset. 2d. High contrast. No shadows
Labrys personaje de Persona 4 Arena con ropa de tendera.. In-Game asset. 2d. High contrast. No shadows
Mesa de tienda para poner un personaje detras. In-Game asset. 2d. High contrast. No shadows
Tecla gris. In-Game asset. 2d. High contrast. No shadows
Caca rosada. In-Game asset. 2d. High contrast. No shadows
Jabón. In-Game asset. 2d. High contrast. No shadows