Code edit (7 edits merged)
Please save this source code
User prompt
Add the asset bird on top edge of the house
Code edit (8 edits merged)
Please save this source code
User prompt
Remove the bottom duplication of text5-6-7-8 in the code but let the top texts from 1 to 8.
Code edit (1 edits merged)
Please save this source code
User prompt
Add text5 6 7 8 to the game
Code edit (1 edits merged)
Please save this source code
User prompt
Add text5 6 7 8 below text1 2 3 4
Code edit (1 edits merged)
Please save this source code
User prompt
Add the text2 and3 and 4 to the game
User prompt
Add text2 after text1 and text3 and text4
Code edit (1 edits merged)
Please save this source code
Code edit (3 edits merged)
Please save this source code
User prompt
Scale the number score a bit
Code edit (7 edits merged)
Please save this source code
User prompt
Make the number of score smaller
Code edit (1 edits merged)
Please save this source code
User prompt
Name the text text1
User prompt
Remove grid7
User prompt
Add small text of score when resources collected make it text 1 but the number of score make it "0", make its position top middle.
User prompt
Remove all grids and all texts
Code edit (2 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Cannot read properties of undefined (reading 'toString')' in or related to this line: 'var text4 = new Text2(score.toString(), {' Line Number: 49
User prompt
Set the 0 of each text as scor number for count the ressource
Code edit (5 edits merged)
Please save this source code
/**** * Classes ****/ // House class representing upgradeable houses var House = Container.expand(function () { var self = Container.call(this); var houseGraphics = self.attachAsset('house', { anchorX: 0.5, anchorY: 0.5 }); self.upgrade = function (resource) { // Logic for upgrading house with a resource }; }); /**** * Initialize Game ****/ //<Assets used in the game will automatically appear here> //<Write imports for supported plugins here> var game = new LK.Game({ backgroundColor: 0x000000 //Init game with black background }); /**** * Game Code ****/ // Initialize arrays and variables var resources = []; var houses = []; var score = 0; var resources = []; var houses = []; var score = 0; // Function to create houses function createHouse(x, y) { var house = new House(); house.x = x; // Position the house at the given x coordinate house.y = y; // Position the house at the given y coordinate houses.push(house); game.addChild(house); } createHouse(1705, 1580); var wall = LK.getAsset('wall1', { anchorX: 0.5, anchorY: 0, x: 1017, y: 0, scaleX: 2 }); game.addChild(wall); game.down = function (x, y, obj) {}; game.up = function (x, y, obj) {}; // Update game logic // Add a small text of score at the top middle of the screen var text1 = new Text2('0', { size: 40, fill: 0xad6d19 }); text1.anchor.set(15, -0.2); // Center the text horizontally at the top LK.gui.top.addChild(text1); var grass = LK.getAsset('grass', { anchorX: 0.5, anchorY: -1, x: 1024, y: 1366, scaleX: 1, scaleY: 1 }); game.addChildAt(grass, 0); // Add sky asset to the game as background var sky = LK.getAsset('sky', { anchorX: 0.5, anchorY: 0.58, x: 1024, y: 1310, scaleX: 7, scaleY: 5.6 }); game.addChildAt(sky, 0); // Add dirt asset to the game as background var dirt = LK.getAsset('dirt', { anchorX: 0.10, anchorY: -1.66, x: 100, y: 500, scaleX: 19, scaleY: 3 }); game.addChildAt(dirt, 1); game.update = function () { houses.forEach(function (house) { // Logic for house updates }); };
===================================================================
--- original.js
+++ change.js
@@ -53,9 +53,9 @@
game.up = function (x, y, obj) {};
// Update game logic
// Add a small text of score at the top middle of the screen
var text1 = new Text2('0', {
- size: 30,
+ size: 40,
fill: 0xad6d19
});
text1.anchor.set(15, -0.2); // Center the text horizontally at the top
LK.gui.top.addChild(text1);
@@ -63,10 +63,10 @@
anchorX: 0.5,
anchorY: -1,
x: 1024,
y: 1366,
- scaleX: 1.2,
- scaleY: 1.2
+ scaleX: 1,
+ scaleY: 1
});
game.addChildAt(grass, 0);
// Add sky asset to the game as background
var sky = LK.getAsset('sky', {
2D wreckage of wood, square, HD colors. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
House from the front facing the screen with big sign above it have description "SHOP", Hd colors
Flat cleared desert from the top, square Images only no diagonal, with one area of water, no text, no pixels of colors, no grids lines H/V. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
coin, have "AD" not "$", hd colors. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows