User prompt
Please fix the bug: 'TypeError: LK.getSound(...).play() is undefined' in or related to this line: 'LK.getSound('kakas').play().on('end', function () {' Line Number: 89
User prompt
play k1 sound after the kakas sound is finished.
User prompt
Please fix the bug: 'TypeError: game.start is not a function' in or related to this line: 'game.start();' Line Number: 87
User prompt
Play kakas sound only in the game starts.
User prompt
Play kakas sound when the game is start.
User prompt
Play L1 sound when the womer asset reach the shit asset.
User prompt
Play k1 sound when the mower asset touch the shit asset.
User prompt
reduce the dog shit asset to 4 piece.
User prompt
Move the dogsmile asset to the right bottom.
User prompt
Please fix the bug: 'TypeError: setTimeout is not a function' in or related to this line: 'setTimeout(function () {' Line Number: 201
User prompt
Add a shit asset. When the mower asset touches the shit asset, display the dogsmile asset in the middle for 3 seconds.
User prompt
Add asset to the game and when the mower asset reach it the game give an asset in the center for 3 seconds.
User prompt
Add asset to the game and when the mower asset reach it the game give a pop up asset in the center.
User prompt
Add k1 to the game from the start.
User prompt
In Every map start the mower asset is on the center.
User prompt
Every map has 6 bomb.
User prompt
The bomb assets nevet touch the grass assets.
User prompt
Stop playing g1 Music when the mower asset is touch the fence asset.
User prompt
Please fix the bug: 'TypeError: LK.init is undefined' in or related to this line: 'LK.init.text('congratsText', {' Line Number: 199
User prompt
When the player reaches all MONEY24:, then Write out to him as a reward: Congratulations! Everything is trimmed. Level accomplished. Sh*t up and take my money! ;)
User prompt
When the player reaches all MONEY24:, then Write out to him as a reward: Congratulations! Everything is trimmed. Level accomplished. Sh*t up and take my money! ;)
User prompt
When the player reaches all MONEY24:, then Write out to him as a reward: Congratulations! Everything is trimmed. Level accomplished. Sh*t up and take my money!
User prompt
When the player reach the MONEY: 24 grass asset, then Reward it with a pop-up asset.
User prompt
Stop playing the g1 Sound when, the mower is on the fence asset or touch the bomb asset.
User prompt
Add g1 Music to the game. Start the Play when the mower asset moves.
/**** * Classes ****/ // Bomb class var Bomb = Container.expand(function () { var self = Container.call(this); var bombGraphics = self.attachAsset('bomb', { anchorX: 0.5, anchorY: 0.5 }); self.exploded = false; self.update = function () { // Update logic for the bomb }; }); // Fence class var Fence = Container.expand(function () { var self = Container.call(this); var fenceGraphics = self.attachAsset('fence', { anchorX: 0.5, anchorY: 0.5 }); }); // GrassPatch class var GrassPatch = Container.expand(function () { var self = Container.call(this); var grassGraphics = self.attachAsset('grass', { anchorX: 0.5, anchorY: 0.5 }); self.cut = false; self.update = function () { // Update logic for the grass patch }; }); //<Assets used in the game will automatically appear here> // LawnMower class var LawnMower = Container.expand(function () { var self = Container.call(this); var mowerGraphics = self.attachAsset('mower', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 1.25; self.update = function () { // Update logic for the lawnmower }; }); // Shit class var Shit = Container.expand(function () { var self = Container.call(this); var shitGraphics = self.attachAsset('shit', { anchorX: 0.5, anchorY: 0.5 }); self.update = function () { // Update logic for the shit }; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x008000 // Init game with green background }); /**** * Game Code ****/ // Initialize arrays and variables var lawnMower; var grassPatches = []; var scoreTxt; var score = 0; // Create and position the lawnmower at the center of the map lawnMower = new LawnMower(); lawnMower.x = 2048 / 2; lawnMower.y = 2732 / 2; // Play k1 sound at the start of the game LK.getSound('k1').play(); // Create and position the fence assets around the sidelines var fenceTop = []; var fenceBottom = []; var fenceLeft = []; var fenceRight = []; for (var i = 0; i < 2048; i += 200) { var top = game.addChild(new Fence()); top.x = i; top.y = 0; fenceTop.push(top); var bottom = game.addChild(new Fence()); bottom.x = i; bottom.y = 2732 - 200; fenceBottom.push(bottom); } for (var i = 200; i < 2732 - 200; i += 200) { var left = game.addChild(new Fence()); left.x = 0; left.y = i; fenceLeft.push(left); var right = game.addChild(new Fence()); right.x = 2048 - 200; right.y = i; fenceRight.push(right); } // Create and position grass patches, bombs, and shits randomly var bombs = []; var shits = []; for (var i = 0; i < 24; i++) { var grassPatch = new GrassPatch(); do { grassPatch.x = Math.floor(Math.random() * (2048 - 4 * grassPatch.width)) + 2 * grassPatch.width; grassPatch.y = Math.floor(Math.random() * (2732 - 4 * grassPatch.height)) + 2 * grassPatch.height; } while (grassPatches.some(function (patch) { return Math.abs(patch.x - grassPatch.x) < grassPatch.width && Math.abs(patch.y - grassPatch.y) < grassPatch.height; })); grassPatches.push(grassPatch); game.addChild(grassPatch); } // Ensure there are exactly 6 bombs for (var i = 0; i < 6; i++) { var bomb = new Bomb(); do { bomb.x = Math.floor(Math.random() * (2048 - 3 * bomb.width)) + 2 * bomb.width; bomb.y = Math.floor(Math.random() * (2732 - 3 * bomb.height)) + 2 * bomb.height; } while (grassPatches.some(function (patch) { return Math.abs(patch.x - bomb.x) < bomb.width && Math.abs(patch.y - bomb.y) < bomb.height; })); bombs.push(bomb); game.addChild(bomb); } // Ensure there are exactly 6 shits for (var i = 0; i < 6; i++) { var shit = new Shit(); do { shit.x = Math.floor(Math.random() * (2048 - 3 * shit.width)) + 2 * shit.width; shit.y = Math.floor(Math.random() * (2732 - 3 * shit.height)) + 2 * shit.height; } while (grassPatches.some(function (patch) { return Math.abs(patch.x - shit.x) < shit.width && Math.abs(patch.y - shit.y) < shit.height; })); shits.push(shit); game.addChild(shit); } // Create and position the score text scoreTxt = new Text2('Score: 0', { size: 100, fill: "#ffffff" }); scoreTxt.anchor.set(0.5, 0); LK.gui.top.addChild(scoreTxt); // Handle move events function handleMove(x, y, obj) { lawnMower.x = x; lawnMower.y = y; if (!fenceTop.some(function (f) { return lawnMower.intersects(f); }) && !fenceBottom.some(function (f) { return lawnMower.intersects(f); }) && !fenceLeft.some(function (f) { return lawnMower.intersects(f); }) && !fenceRight.some(function (f) { return lawnMower.intersects(f); }) && !bombs.some(function (bomb) { return lawnMower.intersects(bomb); }) && !shits.some(function (shit) { return lawnMower.intersects(shit); })) { LK.playMusic('g1'); } else if (fenceTop.some(function (f) { return lawnMower.intersects(f); }) || fenceBottom.some(function (f) { return lawnMower.intersects(f); }) || fenceLeft.some(function (f) { return lawnMower.intersects(f); }) || fenceRight.some(function (f) { return lawnMower.intersects(f); }) || shits.some(function (shit) { if (lawnMower.intersects(shit)) { var dogsmile = LK.getAsset('Dogsmile', { anchorX: 0.5, anchorY: 0.5, x: 2048 - 250, y: 2732 - 250 }); game.addChild(dogsmile); LK.setTimeout(function () { game.removeChild(dogsmile); }, 3000); } return lawnMower.intersects(shit); }) || bombs.some(function (bomb) { return lawnMower.intersects(bomb); })) { LK.stopMusic(); LK.getSound('k1').stop(); } // Check for collision with grass patches and bombs for (var i = 0; i < grassPatches.length; i++) { if (!grassPatches[i].cut && lawnMower.intersects(grassPatches[i])) { grassPatches[i].cut = true; grassPatches[i].alpha = 0.5; // Visually indicate the grass is cut score++; scoreTxt.setText('MONEY: ' + score); if (score === 24) { var rewardPopup = LK.getAsset('rewardPopup', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2 }); game.addChild(rewardPopup); var congratsText = new Text2('Congratulations!\n\nEverything is trimmed.\n\nLevel accomplished.\n\nSh*t up and take my money! ;)', { size: 100, fill: "#ffffff", align: "center" }); congratsText.anchor.set(0.5, 0.5); congratsText.x = 2048 / 2; congratsText.y = 2732 / 2; game.addChild(congratsText); } } } for (var i = 0; i < bombs.length; i++) { if (!bombs[i].exploded && lawnMower.intersects(bombs[i])) { bombs[i].exploded = true; bombs[i].alpha = 0.5; // Visually indicate the bomb has exploded // Stop k1 sound LK.getSound('k1').stop(); // End the game if a bomb is hit LK.showGameOver(); } } } // Mouse or touch move on game object game.move = handleMove; // Mouse or touch down on game object game.down = function (x, y, obj) { handleMove(x, y, obj); }; // Mouse or touch up on game object game.up = function (x, y, obj) { // No action needed on up event }; // Add the lawnmower to the game game.addChild(lawnMower); // Update game logic game.update = function () { // Update lawnmower and grass patches lawnMower.update(); for (var i = 0; i < grassPatches.length; i++) { grassPatches[i].update(); } }; // Removed undefined LK.init.text call
===================================================================
--- original.js
+++ change.js
@@ -179,10 +179,10 @@
if (lawnMower.intersects(shit)) {
var dogsmile = LK.getAsset('Dogsmile', {
anchorX: 0.5,
anchorY: 0.5,
- x: 2048 / 2,
- y: 2732 / 2
+ x: 2048 - 250,
+ y: 2732 - 250
});
game.addChild(dogsmile);
LK.setTimeout(function () {
game.removeChild(dogsmile);
grass. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
grass mower.
Bomb.
Paving stone. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Congratulation! Green wallpapper.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
dog smile. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
dog shit. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
blue and green button with "GO TO THE NEXT MAP" text.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.