User prompt
Grass asset placement: they cannot touch the fence asset.
User prompt
Place grass assets on the map so that they never touch the fence asset.
User prompt
Place grass assets randomly so that they never touch the fence asset at any time.
User prompt
Place grass assets randomly so that they never touch each other at any time.
User prompt
Reduce the number of grass assets to 24 pieces.
User prompt
The fence Asset should never obscure Mower Asset under any circumstances.
User prompt
The fence asset runs around the background as a single frame.
User prompt
Make a nice wooden fence as a frame on the sidelines.
User prompt
Make a wooden fence as a frame on the sidelines.
User prompt
Place the grass assets on the pitch so that they never touch each other.
User prompt
The grass asset should never be completely placed on the sidelines, it should always be placed one asset away from it.
User prompt
The bomb asset should never be completely placed on the sidelines, it should always be placed two asset away from it.
User prompt
The bomb asset should never be completely placed on the sidelines, it should always be placed one asset away from it.
User prompt
Reduce the number of asset grass on a level to 50 pieces.
User prompt
Reduce the number of asset grass on a level to 40 pieces.
User prompt
Reduce the number of asset grass on a level to 20 pieces.
User prompt
Change the score: title to MONEY:
User prompt
A bombák száma egy pályán maximum 5 legyen.
User prompt
For each game launch, grass and bomb placement should be random.
User prompt
For each game launch, grass and bomb placement should be random.
User prompt
Make a minesweeper game using grass asset.
User prompt
Create a rare maze from grass asset.
User prompt
Slow down the movement of the lawn cutter asset to half this speed.
User prompt
Slow down the movement of the lawn cutter asset to half the speed.
User prompt
Slow down the movement of the lawn cutter asset to half this speed.
/**** * 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 }; }); /**** * 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 lawnMower = new LawnMower(); lawnMower.x = 2048 / 2; lawnMower.y = 2732 - 200; // Create and position the fence assets around the sidelines for (var i = 0; i < 2048; i += 200) { var fenceTop = game.addChild(new Fence()); fenceTop.x = i; fenceTop.y = 0; var fenceBottom = game.addChild(new Fence()); fenceBottom.x = i; fenceBottom.y = 2732 - 200; } for (var i = 200; i < 2732 - 200; i += 200) { var fenceLeft = game.addChild(new Fence()); fenceLeft.x = 0; fenceLeft.y = i; var fenceRight = game.addChild(new Fence()); fenceRight.x = 2048 - 200; fenceRight.y = i; } // Create and position grass patches and bombs randomly var bombs = []; for (var i = 0; i < 24; i++) { var grassPatch = new GrassPatch(); do { grassPatch.x = Math.floor(Math.random() * (2048 - 2 * grassPatch.width)) + grassPatch.width; grassPatch.y = Math.floor(Math.random() * (2732 - 2 * grassPatch.height)) + grassPatch.height; } while (grassPatches.some(function (patch) { return Math.sqrt(Math.pow(patch.x - grassPatch.x, 2) + Math.pow(patch.y - grassPatch.y, 2)) < 2 * grassPatch.width; })); grassPatches.push(grassPatch); game.addChild(grassPatch); // Randomly place bombs if (Math.random() < 0.2 && bombs.length < 5) { var bomb = new Bomb(); 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; bombs.push(bomb); game.addChild(bomb); } } // 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; // 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); } } 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 // 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(); } };
===================================================================
--- original.js
+++ change.js
@@ -90,9 +90,9 @@
do {
grassPatch.x = Math.floor(Math.random() * (2048 - 2 * grassPatch.width)) + grassPatch.width;
grassPatch.y = Math.floor(Math.random() * (2732 - 2 * grassPatch.height)) + grassPatch.height;
} while (grassPatches.some(function (patch) {
- return Math.abs(patch.x - grassPatch.x) < grassPatch.width && Math.abs(patch.y - grassPatch.y) < grassPatch.height;
+ return Math.sqrt(Math.pow(patch.x - grassPatch.x, 2) + Math.pow(patch.y - grassPatch.y, 2)) < 2 * grassPatch.width;
}));
grassPatches.push(grassPatch);
game.addChild(grassPatch);
// Randomly place bombs
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.