Code edit (5 edits merged)
Please save this source code
User prompt
character cannot spawn on a wall tile
User prompt
tint the tile floor with light grey
Code edit (3 edits merged)
Please save this source code
User prompt
preserve the original size of the shadow
User prompt
add a shadow blob on the feet of the character
User prompt
character is not moving to the selected tile, debug it
User prompt
animate the character with an idle animation
User prompt
Please fix the bug: 'ReferenceError: moveCharacter is not defined' in or related to this line: 'moveCharacter(path);' Line Number: 204
User prompt
rename the asset mouse to character
User prompt
using path finding move the mouse to the mouse selectedTile, mouse must move following the grid
User prompt
on the start of the game spawn the mouse on a random tile
User prompt
clear tile tint when a new tile is selected, save the selected tile in a variable call the variable selectedTile
User prompt
highlight the tile that is under toiuch input
User prompt
add a border of wall tiles around the map, call the asset and variable wallTile
Code edit (1 edits merged)
Please save this source code
User prompt
create a grid that covers all the screen, expose the grid size variable
User prompt
delete all, start from fresh
User prompt
remove all but one floor tile
Code edit (1 edits merged)
Please save this source code
User prompt
add a border to the map
User prompt
add 2 more floor tile assets and randomize them on the grid
Code edit (4 edits merged)
Please save this source code
User prompt
remove all walls
User prompt
delete all references for the wall asset
/**** * Classes ****/ // Border class var Border = Container.expand(function () { var self = Container.call(this); var borderTile = self.attachAsset('borderTile', { anchorX: 0.5, anchorY: 0.5, width: 2048 / self.gridSize, height: 2048 / self.gridSize }); }); // Grid class var Grid = Container.expand(function () { var self = Container.call(this); self.grid = []; self.gridSize = 10; var cellSize = 2048 / self.gridSize; for (var i = 0; i < self.gridSize; i++) { self.grid[i] = []; for (var j = 0; j < self.gridSize; j++) { self.grid[i][j] = null; var floorTileType = Math.floor(Math.random() * 3) + 1; var floorTile = self.attachAsset('floorTile' + floorTileType, { anchorX: 0.5, anchorY: 0.5, x: i * cellSize + cellSize / 2, y: j * cellSize + cellSize / 2, width: cellSize, height: cellSize }); self.addChild(floorTile); // Add border tiles if (i == 0 || i == self.gridSize - 1 || j == 0 || j == self.gridSize - 1) { var borderTile = self.attachAsset('borderTile', { anchorX: 0.5, anchorY: 0.5, x: i * cellSize + cellSize / 2, y: j * cellSize + cellSize / 2, width: cellSize, height: cellSize }); self.addChild(borderTile); } } } }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 }); /**** * Game Code ****/ var grid = game.addChild(new Grid());
===================================================================
--- original.js
+++ change.js
@@ -1,7 +1,17 @@
/****
* Classes
****/
+// Border class
+var Border = Container.expand(function () {
+ var self = Container.call(this);
+ var borderTile = self.attachAsset('borderTile', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ width: 2048 / self.gridSize,
+ height: 2048 / self.gridSize
+ });
+});
// Grid class
var Grid = Container.expand(function () {
var self = Container.call(this);
self.grid = [];
@@ -20,8 +30,20 @@
width: cellSize,
height: cellSize
});
self.addChild(floorTile);
+ // Add border tiles
+ if (i == 0 || i == self.gridSize - 1 || j == 0 || j == self.gridSize - 1) {
+ var borderTile = self.attachAsset('borderTile', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: i * cellSize + cellSize / 2,
+ y: j * cellSize + cellSize / 2,
+ width: cellSize,
+ height: cellSize
+ });
+ self.addChild(borderTile);
+ }
}
}
});
grey square, black border. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
simple light yellow button front view game console, clean, rounded edges, high resolution, graphic. Single Game Texture. In-Game asset. 2d. Blank background. High contrast.
Worn out sticker for a video game, 90s style, cheese, simple, vintage. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
wall view from top-down, game asset videogame, black color, simple. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows. worn out sticker. 90's style. vintage. simple. top-down view. poster. sticker
top-down view, videogame character enemy, roomba, 90s style sticker, flat, no perspective, silhouette, black and white, cartoon, fun, simple, from above. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
top-down view, videogame heart, 90s style sticker, flat, no perspective, silhouette, white, cartoon, fun, simple, from above. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Black square with white outline. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.