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
User prompt
add north wall assets to the top part of the screen, south wall assets to the bottom part of the screen, east wall asset to the left and west walls to the right
Code edit (1 edits merged)
Please save this source code
User prompt
make the outer wall half the size and expose the variable
User prompt
make a close loop of walls around the screen edge
User prompt
push the wall asset to the edges of the screen
User prompt
surround the grid with the wall asset
Code edit (1 edits merged)
Please save this source code
User prompt
offset grid by .5 so no cell clips
Code edit (1 edits merged)
Please save this source code
User prompt
fill the screen with the grid
User prompt
draw the grid on screen
User prompt
expose the grid size as a variable
User prompt
create a grid
User prompt
let's start fresh, remove all.
User prompt
Please fix the bug: 'Uncaught ReferenceError: Mouse is not defined' in or related to this line: 'var mouse = new Mouse();' Line Number: 59
User prompt
remove mouse, cat and hole classes, add a visual representation of the grid on screen
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot set properties of undefined (setting '13.66')' in or related to this line: 'self.grid[x][y] = obj;' Line Number: 37
User prompt
add a grid and discrete movement for the mouse
User prompt
Add a maze and collision
/**** * 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 = 20; 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
@@ -14,9 +14,9 @@
// Grid class
var Grid = Container.expand(function () {
var self = Container.call(this);
self.grid = [];
- self.gridSize = 10;
+ self.gridSize = 20;
var cellSize = 2048 / self.gridSize;
for (var i = 0; i < self.gridSize; i++) {
self.grid[i] = [];
for (var j = 0; j < self.gridSize; j++) {
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.