User prompt
haz que a lo que llege a los 300 segundos, gane el juego y aparezca su score tambien
User prompt
haz que cada 10 segundo se sume 1 de score
User prompt
y haz que cada 10 segundos aparezcan mas moneditas cada segundo
User prompt
haz que cada 10 segundos, monedita se mueva mas rapido
User prompt
Please fix the bug: 'LK.saveGame is not a function' in or related to this line: 'return child instanceof Monedita;' Line Number: 87
User prompt
Please fix the bug: 'fueguito is not defined' in or related to this line: 'LK.saveGame({' Line Number: 66
User prompt
Please fix the bug: 'fueguito is not defined' in or related to this line: 'LK.saveGame({' Line Number: 66
User prompt
guarda el juego
User prompt
cuando asset fueguito toque al asset monedita, pierda el juego
User prompt
haz que cuando el bullet haga desaparecer a monedita, el desaparezca tambien
User prompt
haz que cuando el asset monedita toque el asset bullet, el asset monedita desaparese
User prompt
haz que cuando se toque el mouse, lanze un asset bullet y va para arriba hasta que despaparezca
User prompt
haz que cuando el asset fueguito toque el asset monedita, pierdas el juego
User prompt
haz que el asset fueguito le siga al mouse
User prompt
haz que cada segundo aparezca el asset Monedita y baje hasta el piso y desaparezca
User prompt
haz el background blanco
User prompt
mas grande
User prompt
necesito hacer que aparesca el asset fueguito
User prompt
quiero quitar el codigo
Initial prompt
MoneditaFueguitoXD
/****
* Classes
****/
// Create a Bullet class
var Bullet = Container.expand(function () {
var self = Container.call(this);
// Attach the 'bullet' asset to the Bullet class
var bulletGraphics = self.attachAsset('bullet', {
anchorX: 0.5,
anchorY: 0.5
});
// Set the speed of the Bullet class
self.speed = -5;
// This is automatically called every game tick, if the Bullet class is attached!
self.update = function () {
self.y += self.speed;
// If the Bullet class reaches the top of the screen, destroy it
if (self.y < 0) {
self.destroy();
}
};
});
// Create a Monedita class
var Monedita = Container.expand(function () {
var self = Container.call(this);
// Attach the 'Monedita' asset to the Monedita class
var moneditaGraphics = self.attachAsset('Monedita', {
anchorX: 0.5,
anchorY: 0.5
});
// Set the speed of the Monedita class
self.speed = 5;
// This is automatically called every game tick, if the Monedita class is attached!
self.update = function () {
self.y += self.speed;
// If the Monedita class reaches the bottom of the screen, destroy it
if (self.y > 2732) {
self.destroy();
}
// If 'fueguito' intersects with 'monedita', trigger game over
if (self.intersects(fueguito)) {
LK.showGameOver();
}
};
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0xFFFFFF
});
/****
* Game Code
****/
// Mouse or touch down on game object
game.down = function (x, y, obj) {
// Create a Bullet instance
var bullet = new Bullet();
bullet.x = x; // Start at the current mouse position
bullet.y = y;
game.addChild(bullet);
};
game.move = function (x, y, obj) {
// Make the 'fueguito' asset follow the mouse
fueguito.x = x;
fueguito.y = y;
};
var fueguito = LK.getAsset('fueguito', {
anchorX: 0.5,
anchorY: 0.5,
x: 1024,
y: 1366,
scaleX: 2,
scaleY: 2
});
// Add the 'fueguito' asset to the game
game.addChild(fueguito);
// Create a Monedita instance every second
var moneditaSpeed = 5;
var moneditaCount = 1;
LK.setInterval(function () {
for (var i = 0; i < moneditaCount; i++) {
var monedita = new Monedita();
monedita.x = Math.random() * 2048; // Random x position
monedita.y = 0; // Start at the top of the screen
monedita.speed = moneditaSpeed;
game.addChild(monedita);
}
}, 1000);
// Increase the speed of 'monedita' and add 1 to the score every 10 seconds
// If the game has been running for 300 seconds, show the win screen and the score
LK.setInterval(function () {
moneditaSpeed += 1;
moneditaCount += 1;
LK.setScore(LK.getScore() + 1);
if (LK.getScore() >= 30) {
LK.showYouWin();
LK.setScore(LK.getScore());
}
}, 10000);
; ===================================================================
--- original.js
+++ change.js
@@ -89,10 +89,15 @@
game.addChild(monedita);
}
}, 1000);
// Increase the speed of 'monedita' and add 1 to the score every 10 seconds
+// If the game has been running for 300 seconds, show the win screen and the score
LK.setInterval(function () {
moneditaSpeed += 1;
moneditaCount += 1;
LK.setScore(LK.getScore() + 1);
+ if (LK.getScore() >= 30) {
+ LK.showYouWin();
+ LK.setScore(LK.getScore());
+ }
}, 10000);
;
\ No newline at end of file