User prompt
Please fix the bug: 's.apply(...).then is not a function' in or related to this line: 'if (self.x < -LK.getAsset('obstacle', {}).width) {' Line Number: 25
User prompt
Please fix the bug: 's.apply(...).then is not a function' in or related to this line: 'if (self.y <= 0) {' Line Number: 47
User prompt
Please fix the bug: 's.apply(...).then is not a function' in or related to this line: 'if (self.y <= 0) {' Line Number: 47
User prompt
Please fix the bug: 'TypeError: self.getAsset is not a function' in or related to this line: 'if (self.x < -self.getAsset('obstacle', {}).width) {' Line Number: 25
User prompt
Please fix the bug: 's.apply(...).then is not a function' in or related to this line: 'if (self.x < -self.width) {' Line Number: 25
User prompt
Please fix the bug: 's.apply(...).then is not a function' in or related to this line: 'if (self.y <= 0) {' Line Number: 47
User prompt
Please fix the bug: 's.apply(...).then is not a function' in or related to this line: 'if (self.x < -self.width) {' Line Number: 25
User prompt
Please fix the bug: 's.apply(...).then is not a function' in or related to this line: 'if (self.y <= 0) {' Line Number: 49
User prompt
Please fix the bug: 's.apply(...).then is not a function' in or related to this line: 'if (self.y < 0) {' Line Number: 49
User prompt
Please fix the bug: 's.apply(...).then is not a function' in or related to this line: 'if (self.x < -self.width) {' Line Number: 25
User prompt
make the pig tilt up when it flies up
User prompt
make the pig onlu tilt down to a cirtain degree so it doesnt spin
User prompt
fix the bugs where the pig spins
User prompt
when the pig flies up it tilts up
User prompt
make the pig tilt a bith down when it drops down
User prompt
make the pig 3 times bigger
User prompt
make the pig die if touches the top edge of the screen
User prompt
make it that if the pig goes to far up it dies (top edge of the screen)
User prompt
fix the bug where the pig dies without even touching the obsticle
Code edit (1 edits merged)
Please save this source code
User prompt
make the obsticle randomly bigger by 3 to 5 times
Code edit (1 edits merged)
Please save this source code
User prompt
when clicked on banana a point is added
User prompt
make the banana 2 times bigger
User prompt
make it 4 times bigger
/**** * Classes ****/ //<Assets used in the game will automatically appear here> // Banana class var Banana = Container.expand(function () { var self = Container.call(this); var bananaGraphics = self.attachAsset('banana', { anchorX: 0.5, anchorY: 0.5, scaleX: 8, scaleY: 8 }); self.update = function () { // No specific update logic for bananas }; }); // Upgrade class var Upgrade = Container.expand(function () { var self = Container.call(this); var upgradeGraphics = self.attachAsset('upgrade', { anchorX: 0.5, anchorY: 0.5 }); self.update = function () { // No specific update logic for upgrades }; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 //Init game with black background }); /**** * Game Code ****/ // Initialize variables var bananas = []; var upgrades = []; var score = 0; var scoreTxt = new Text2('0', { size: 150, fill: "#ffffff" }); scoreTxt.anchor.set(0.5, 0); LK.gui.top.addChild(scoreTxt); // Function to update score function updateScore() { scoreTxt.setText(score); } // Function to create a new banana function createBanana(x, y) { var newBanana = new Banana(); newBanana.x = x; newBanana.y = y; bananas.push(newBanana); game.addChild(newBanana); } // Function to create a new upgrade function createUpgrade(x, y) { var newUpgrade = new Upgrade(); newUpgrade.x = x; newUpgrade.y = y; upgrades.push(newUpgrade); game.addChild(newUpgrade); } // Handle touch down event game.down = function (x, y, obj) { // Check if a banana was clicked for (var i = bananas.length - 1; i >= 0; i--) { if (bananas[i].intersects({ x: x, y: y })) { score++; updateScore(); bananas[i].destroy(); bananas.splice(i, 1); return; } } }; // Game update function game.update = function () {}; // Initialize the game with a single banana at the center createBanana(2048 / 2, 2732 / 2);
===================================================================
--- original.js
+++ change.js
@@ -7,10 +7,10 @@
var self = Container.call(this);
var bananaGraphics = self.attachAsset('banana', {
anchorX: 0.5,
anchorY: 0.5,
- scaleX: 4,
- scaleY: 4
+ scaleX: 8,
+ scaleY: 8
});
self.update = function () {
// No specific update logic for bananas
};