User prompt
Coloca a loja no topo do cara desconhecido.
User prompt
Coloca ele no topo do cara desconhecido.
User prompt
Please fix the bug: 'Uncaught TypeError: LK.getCoinGain is not a function' in or related to this line: 'LK.setCoinGain(LK.getCoinGain() + 1);' Line Number: 112
User prompt
Please fix the bug: 'LK.setCoinGain is not a function' in or related to this line: 'LK.setCoinGain(1);' Line Number: 176
User prompt
Passa que quando o cara desconhecido abre a jaqueta, abre uma aba de loja que pode aumentar o ganho de moedas, melhorando o moeda ganho.
User prompt
Coloquei no solo.
User prompt
Please fix the bug: 'TypeError: person1.walk is not a function' in or related to this line: 'person1.walk();' Line Number: 196
User prompt
Please fix the bug: 'TypeError: person1.walk is not a function' in or related to this line: 'person1.walk();' Line Number: 196
User prompt
Faça com que o asset da pessoa 1 seja o outro sprite em vez do cara desconhecido
User prompt
Faça com que o asset da pessoa 1 volte ao normal
User prompt
Coloque o ácido da pessoa de volta, porque ela tá com o mesmo spray que o cara desconhecido.
User prompt
Não, não era pra mudar o ácide da pessoa. Era pra só colocar ele. Traga o Sprite da pessoa de volta.
User prompt
Please fix the bug: 'TypeError: person1.walk is not a function' in or related to this line: 'person1.walk();' Line Number: 160
User prompt
Please fix the bug: 'ReferenceError: person1 is not defined' in or related to this line: 'person1.x += 5;' Line Number: 157
User prompt
Adicione o Sprite 1 do cara desconhecido que quando clicado vai para o Sprite 2
User prompt
O caminho desconhecido, basicamente você pode comprar coisas, como aumentar o ganho de moedas por clique ou moedas por segundo.
User prompt
Ele tá dando muito mais que uma moeda.
User prompt
Please fix the bug: 'ReferenceError: spriteIndex is not defined' in or related to this line: 'if (person1.isWalking && spriteIndex == 0) {' Line Number: 163
User prompt
Por que ele tá dando tantas moedas? Era pra ele só dar uma.
User prompt
Está dando muito lag.
User prompt
Coloca ele na esquerda.
User prompt
Ele tá todo bugado.
User prompt
Faça com que ele venha para a direita, não para a esquerda.
User prompt
Faça com que ela venha para a direita e ande com os 4 sprites.
User prompt
Ela não tá aparecendo na cena.
/**** * Classes ****/ //<Assets used in the game will automatically appear here> //<Write imports for supported plugins here> // Class for the clickable object var ClickableObject = Container.expand(function () { var self = Container.call(this); var clickableGraphics = self.attachAsset('clickable', { anchorX: 0.5, anchorY: 0.5, scaleX: 4, scaleY: 4 }); // Event handler for when the object is clicked self.down = function (x, y, obj) { // Increase score LK.setScore(LK.getScore() + 1); scoreTxt.setText(LK.getScore()); // Flash the object to give feedback LK.effects.flashObject(self, 0xffffff, 100); // Create a new coin and add it to the game var coin = game.addChild(new Coin()); coin.x = self.x; coin.y = self.y; // Animate the coin dropping into the vase coin.drop(); }; }); // Class for the coin var Coin = Container.expand(function () { var self = Container.call(this); var coinGraphics = self.attachAsset('Coin', { anchorX: 0.5, anchorY: 0.5, scaleX: 0.5, scaleY: 0.5 }); // Method for the coin dropping animation self.drop = function () { var dropInterval = LK.setInterval(function () { // Calculate the direction vector from the coin to the vase var dx = vase.x - self.x; var dy = vase.y - self.y; var distance = Math.sqrt(dx * dx + dy * dy); // Normalize the direction vector dx /= distance; dy /= distance; // Move the coin towards the vase self.x += dx * 40; // Increase the speed of the coin self.y += dy * 40; // Increase the speed of the coin // If the coin reaches the vase, clear the interval, destroy the coin and update the score if (self.intersects(vase)) { LK.clearInterval(dropInterval); self.destroy(); LK.setScore(LK.getScore() + 1); scoreTxt.setText(LK.getScore()); } }, 50); }; }); // Class for Person1 var Person1 = Container.expand(function () { var self = Container.call(this); var spriteIndex = 0; var sprites = ['Person1sprite1', 'Person1sprite2', 'Person1sprite3']; var person1Graphics = self.attachAsset(sprites[spriteIndex], { anchorX: 0.5, anchorY: 0.5, scaleX: 1, scaleY: 1 }); // Method for the walking animation self.walk = function () { self.isWalking = true; var walkInterval = LK.setInterval(function () { // Cycle through the sprites for the walking animation spriteIndex = (spriteIndex + 1) % sprites.length; person1Graphics = self.attachAsset(sprites[spriteIndex], { anchorX: 0.5, anchorY: 0.5, scaleX: 1, scaleY: 1 }); // Stop walking after one cycle of sprites if (spriteIndex == 0) { self.isWalking = false; LK.clearInterval(walkInterval); } }, 100); }; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 //Init game with black background }); /**** * Game Code ****/ // Initialize score text var scoreTxt = new Text2('0', { size: 150, fill: 0xFFFFFF }); scoreTxt.anchor.set(0.5, 0); LK.gui.top.addChild(scoreTxt); // Add the Background asset to the game scene var background = game.addChild(LK.getAsset('Background', { anchorX: 0.5, anchorY: 0.5, scaleX: 2048 / 100, // Scale to fit the screen width scaleY: 2732 / 100, // Scale to fit the screen height x: 2048 / 2, y: 2732 / 2 })); // Create the clickable object and position it at the bottom of the screen var clickableObject = game.addChild(new ClickableObject()); clickableObject.x = 2048 / 2; clickableObject.y = 2732 - clickableObject.height / 2; // Add the Vase asset to the game scene var vase = game.addChild(LK.getAsset('Vase', { anchorX: 0.5, anchorY: 0.5, scaleX: 2, scaleY: 2, x: clickableObject.x + clickableObject.width + 100, y: clickableObject.y })); // Create Person1 and start the walking animation var person1 = game.addChild(new Person1()); person1.scaleX = clickableObject.width / person1.width; person1.scaleY = clickableObject.height / person1.height; person1.x = person1.width / 2; person1.y = 2732 - person1.height / 2; person1.walk(); // Game update loop game.update = function () { // Make Person1 walk every 3 seconds if (LK.ticks % (3 * 60) == 0) { person1.walk(); } // Move Person1 to the right person1.x += 5; // Create a new coin and add it to the game only if Person1 is walking if (person1.isWalking) { var coin = game.addChild(new Coin()); coin.x = person1.x; coin.y = person1.y; // Animate the coin dropping into the vase coin.drop(); } }; // Removed the game.down event handler
===================================================================
--- original.js
+++ change.js
@@ -71,8 +71,9 @@
scaleY: 1
});
// Method for the walking animation
self.walk = function () {
+ self.isWalking = true;
var walkInterval = LK.setInterval(function () {
// Cycle through the sprites for the walking animation
spriteIndex = (spriteIndex + 1) % sprites.length;
person1Graphics = self.attachAsset(sprites[spriteIndex], {
@@ -80,10 +81,13 @@
anchorY: 0.5,
scaleX: 1,
scaleY: 1
});
- // Move Person1 to the right
- self.x += 5;
+ // Stop walking after one cycle of sprites
+ if (spriteIndex == 0) {
+ self.isWalking = false;
+ LK.clearInterval(walkInterval);
+ }
}, 100);
};
});
@@ -139,15 +143,17 @@
game.update = function () {
// Make Person1 walk every 3 seconds
if (LK.ticks % (3 * 60) == 0) {
person1.walk();
- // Create a new coin and add it to the game
+ }
+ // Move Person1 to the right
+ person1.x += 5;
+ // Create a new coin and add it to the game only if Person1 is walking
+ if (person1.isWalking) {
var coin = game.addChild(new Coin());
coin.x = person1.x;
coin.y = person1.y;
// Animate the coin dropping into the vase
coin.drop();
}
- // Move Person1 to the right
- person1.x += 5;
};
// Removed the game.down event handler
\ No newline at end of file