User prompt
biraz daha
User prompt
level yazısını biraz fazla sağa al
User prompt
çok az sola
User prompt
birazcık daha
User prompt
biraz daha
User prompt
biraz daha
User prompt
kareleri sağa al biraz
User prompt
kareleri büyült
User prompt
karelerin arasındaki mesafeyi 2 katına çıkar
User prompt
tıklamamız gereken karelerin aralarındaki mesafeyi 3 katına çıkar
User prompt
sadece dediğimi yap. Kareler çok küçük kalıyor bunları büyültmeni istiyorum aynı amanda aralarındaki mesafeyi bozma
User prompt
karelerin arasındaki mesafeyi arttır
User prompt
kareleri biraz büyült
User prompt
karelerin arasında çok fazla mesafe olsun
User prompt
kareleri orantılı şekilde büyült
User prompt
karelerin arasında mesafe olacak
User prompt
karelerin arasındaki mesafeyi arttır
User prompt
kareleri 2x büyült
User prompt
baya al sola
User prompt
biraz daha
User prompt
biraaz daha
User prompt
level yazsını birazcık sola al
User prompt
sola al
User prompt
level yazsını ortaya al
User prompt
sola al
/**** * Classes ****/ // Class for the level counter var LevelCounter = Container.expand(function () { var self = Container.call(this); var levelText = new Text2('Level: 1', { size: 150, fill: 0xFFFFFF, align: 'center' }); self.addChild(levelText); self.updateLevel = function (level) { levelText.setText('Level: ' + level); }; }); //<Assets used in the game will automatically appear here> //<Write imports for supported plugins here> // Class for a single square var Square = Container.expand(function () { var self = Container.call(this); var squareGraphics = self.attachAsset('square', { anchorX: 0.5, anchorY: 0.5, scaleX: 2, scaleY: 2 }); self.highlight = function () { squareGraphics.tint = 0xff0000; // Change color to red }; self.reset = function () { squareGraphics.tint = 0xffffff; // Reset color to white }; self.clicked = function () { squareGraphics.tint = 0x00ff00; // Change color to green when clicked }; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 //Init game with black background }); /**** * Game Code ****/ var background = game.attachAsset('background', { anchorX: 0.0, anchorY: 0.0 }); // Initialize the level counter and add it to the game var levelCounter = new LevelCounter(); levelCounter.x = 2048 / 2 - 200; // Move the level counter a bit more to the right levelCounter.y = 100; game.addChild(levelCounter); var grid = []; var sequence = []; var currentLevel = 1; var currentStep = 0; var gridSize = { rows: 4, cols: 5 }; var squareSize = { width: 360, height: 360 }; var gridOffset = { x: (2048 - gridSize.cols * squareSize.width) / 2 + 180, y: (2732 - gridSize.rows * squareSize.height) / 2 + 50 }; // Move the grid a bit more to the left // Initialize grid for (var row = 0; row < gridSize.rows; row++) { grid[row] = []; for (var col = 0; col < gridSize.cols; col++) { var square = new Square(); square.x = gridOffset.x + col * squareSize.width; square.y = gridOffset.y + row * squareSize.height; grid[row][col] = square; game.addChild(square); } } // Function to start a new level function startLevel() { sequence.push({ row: Math.floor(Math.random() * gridSize.rows), col: Math.floor(Math.random() * gridSize.cols) }); currentStep = 0; levelCounter.updateLevel(currentLevel); // Update the level counter showSequence(); } // Function to show the sequence to the player function showSequence() { if (currentStep < sequence.length) { var pos = sequence[currentStep]; grid[pos.row][pos.col].highlight(); LK.setTimeout(function () { grid[pos.row][pos.col].reset(); currentStep++; showSequence(); }, 500); } else { currentStep = 0; } } // Function to handle player's input function handleInput(row, col) { if (sequence[currentStep].row === row && sequence[currentStep].col === col) { if (currentStep > 0) { var prevPos = sequence[currentStep - 1]; grid[prevPos.row][prevPos.col].reset(); } grid[row][col].clicked(); currentStep++; if (currentStep === sequence.length) { currentLevel++; startLevel(); } } else { LK.showGameOver(); } } // Attach event listeners to each square for (var row = 0; row < gridSize.rows; row++) { for (var col = 0; col < gridSize.cols; col++) { (function (r, c) { grid[r][c].down = function () { handleInput(r, c); }; })(row, col); } } // Start the first level startLevel();
===================================================================
--- original.js
+++ change.js
@@ -51,9 +51,9 @@
anchorY: 0.0
});
// Initialize the level counter and add it to the game
var levelCounter = new LevelCounter();
-levelCounter.x = 2048 / 2 - 300; // Move the level counter a bit more to the right
+levelCounter.x = 2048 / 2 - 200; // Move the level counter a bit more to the right
levelCounter.y = 100;
game.addChild(levelCounter);
var grid = [];
var sequence = [];