User prompt
Move 2nd PauseBack 5 pixels to the right
User prompt
Move 2nd PauseBack 40 pixels higher and 10 pixels to the left, make 2nd PauseBack 2% larger
Code edit (1 edits merged)
Please save this source code
User prompt
Make 2nd PauseBack 3% larger and move it 200 pixels higher
Code edit (1 edits merged)
Please save this source code
User prompt
Make Pause Back 25% transparent
User prompt
Make 2nd Pause Back 10% transparent and 2% larger
User prompt
Make 2nd PauseBack 100% dark and 85% transparent
User prompt
Create another Instance of PauseBack and place it right under the original Pause Back. Move new Pauseback 10 pixels lower
User prompt
Move PauseBack 20 pixels down-right
User prompt
Move PauseBack 20 pixels down-left
User prompt
Make PauseBack 1.5 times larger
User prompt
Re-name PauseBreak to PauseBack
User prompt
Move Pause Break 10 pixels to the right and 15 pixels lower down
User prompt
Make PauseBack 3 times larger
User prompt
Create new object PauseBreak and place it in top-left corner, place it above ConcreteBackground
Code edit (5 edits merged)
Please save this source code
User prompt
If Type is equal to 4, randomize NewItem to be and show a number between 3 and 6 instead
User prompt
If Type is equal to 1, set tint of the ItemPlace of that NewItem to 12893E
User prompt
Remove the movement mechanic from all NewItem and ItemPlace
Code edit (1 edits merged)
Please save this source code
Code edit (2 edits merged)
Please save this source code
User prompt
Make ItemPlace and NewItem appear above everything else visually
Code edit (1 edits merged)
Please save this source code
User prompt
Adjust Type randomizer, so type 3 and 4 are 16% chance, and type 1 and 2 are 34% chance
/**** * Classes ****/ var WhiteRectangle = Container.expand(function () { var self = Container.call(this); var rectangleAsset = self.attachAsset('WhiteRectangle', { anchorX: 0.5, anchorY: 0.5 }); rectangleAsset.scale.set(0.25, 0.7); // Increase the height by 100% // Add a variable to store the target scale for each rectangle self.targetScale = Math.random() * 1.5; // Add an update function to stretch the rectangle self.update = function () { // Continuously stretch the rectangle towards the target scale rectangleAsset.scale.x += (self.targetScale - rectangleAsset.scale.x) * 0.02; // When the target scale is reached, pick a new target if (Math.abs(rectangleAsset.scale.x - self.targetScale) < 0.005) { self.targetScale = Math.random() * 1.5; } }; }); /**** * Initialize Game ****/ // Create an array to hold the random numbers //<Assets used in the game will automatically appear here> var game = new LK.Game({ backgroundColor: 0x000000 //Init game with black background }); /**** * Game Code ****/ var randomNumberTexts = []; for (var i = 0; i < 50; i++) { // Create a new Text2 object to display the random number var randomNumberText = new Text2(Math.floor(Math.random() * 10).toString(), { size: 40, fill: 0x4A73B5, font: "Courier New" }); randomNumberText.anchor.set(0.5, 0.5); randomNumberText.x = 2048 / 50 * i; randomNumberText.y = 2732 / 2 + 930; game.addChild(randomNumberText); randomNumberTexts.push(randomNumberText); } // Add an update function to the game to move the numbers to the left game.update = function () { for (var i = 0; i < randomNumberTexts.length; i++) { randomNumberTexts[i].x -= 5; if (randomNumberTexts[i].x < 0) { randomNumberTexts[i].x = 2048; } } }; // Add Concrete as a background to all other items var concreteBackground = LK.getAsset('Concrete', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2, width: 2048, height: 2732, alpha: 1, tint: 0x98bee3 }); game.addChildAt(concreteBackground, 0); // Add ScoreBack behind the score and make it around 1/3 screen long // Add score on top of the screen var scoreTxt = new Text2('0', { size: 135, fill: 0xFFFFFF, font: "Helvetica" }); var scoreBack = LK.getAsset('ScoreBack', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 20 + 75 - 35 + 20 + 40, width: 2048 / 3 * 0.85 * 0.85 * 1.2 * 1.3 * 1.1, height: 150 * 1.3 * 1.3 * 1.4 * 1.2 * 0.85 * 1.2 * 1.3 * 1.3 * 1.1 * 1.2, alpha: 1 }); game.addChild(scoreBack); // Add PainterBackground at the bottom of the screen, above ConcreteBackground var painterBackground = LK.getAsset('PainterBackground', { anchorX: 0.5, anchorY: 1, x: 2048 / 2, y: 2732 - 15 + 15 + 400 - 100 + 50, width: 2048 * 0.9 * 0.95, height: 800 * 1.3 * 1.5, alpha: 1 }); game.addChild(painterBackground); // Add ItemPlace above PainterBackground var itemPlace = LK.getAsset('ItemPlace', { anchorX: 0.5, anchorY: 1, x: 2048 / 2, y: painterBackground.y - painterBackground.height / 2 + 360, // Position it above PainterBackground width: 282, height: 282, alpha: 1, tint: 0xb40421 }); game.addChild(itemPlace); var newItemCenter = new Text2('3', { size: 170, fill: 0xFFFFFF, font: "Arial Black" }); newItemCenter.Type = function () { var rand = Math.random(); if (rand < 0.34) { return 1; } // 34% chance if (rand < 0.68) { return 2; } // 34% chance if (rand < 0.84) { return 3; } // 16% chance return 4; // 16% chance }(); newItemCenter.anchor.set(0.5, 1); newItemCenter.x = itemPlace.x; newItemCenter.y = itemPlace.y - itemPlace.height / 2 + 86; // Moved 11 pixels lower game.addChild(newItemCenter); // Variables to track dragging state var isDraggingCenter = false; var offsetXCenter, offsetYCenter; // Add event listeners for dragging NewItemCenter and its ItemPlace newItemCenter.down = function (x, y, obj) { isDraggingCenter = true; offsetXCenter = newItemCenter.x - x; offsetYCenter = newItemCenter.y - y; // Removed preventDefault call as it causes TypeError }; newItemCenter.move = function (x, y, obj) { if (isDraggingCenter) { newItemCenter.x = x + offsetXCenter; newItemCenter.y = y + offsetYCenter; itemPlace.x = newItemCenter.x; itemPlace.y = newItemCenter.y + itemPlace.height / 2 - 86; } }; newItemCenter.up = function (x, y, obj) { isDraggingCenter = false; }; if (newItemCenter.Type === 1) { itemPlace.tint = 0x2A8D6C; newItemCenter.setText(Math.floor(Math.random() * 5 + 3).toString()); } else if (newItemCenter.Type === 2) { itemPlace.tint = 0xb40421; newItemCenter.setText(Math.floor(Math.random() * 8 + 1).toString()); } else if (newItemCenter.Type === 3) { itemPlace.tint = 0x272775; newItemCenter.setText('2'); } else if (newItemCenter.Type === 4) { itemPlace.tint = 0x174F3C; newItemCenter.setText(Math.floor(Math.random() * 6 + 3).toString()); } // Add two more instances of ItemPlace var itemPlaceLeft = LK.getAsset('ItemPlace', { anchorX: 0.5, anchorY: 1, x: 2048 / 2 - 415, // 415 pixels to the left y: painterBackground.y - painterBackground.height / 2 + 360, width: 282, height: 282, alpha: 1, tint: 0xb40421 }); game.addChild(itemPlaceLeft); var newItemLeft = new Text2('3', { size: 170, fill: 0xFFFFFF, font: "Arial Black" }); newItemLeft.Type = function () { var rand = Math.random(); if (rand < 0.34) { return 1; } // 34% chance if (rand < 0.68) { return 2; } // 34% chance if (rand < 0.84) { return 3; } // 16% chance return 4; // 16% chance }(); newItemLeft.anchor.set(0.5, 1); newItemLeft.x = itemPlaceLeft.x; newItemLeft.y = itemPlaceLeft.y - itemPlaceLeft.height / 2 + 86; // Moved 11 pixels lower game.addChild(newItemLeft); // Variables to track dragging state var isDraggingLeft = false; var offsetXLeft, offsetYLeft; // Add event listeners for dragging NewItemLeft and its ItemPlace newItemLeft.down = function (x, y, obj) { isDraggingLeft = true; offsetXLeft = newItemLeft.x - x; offsetYLeft = newItemLeft.y - y; // Removed preventDefault call as it causes TypeError }; newItemLeft.move = function (x, y, obj) { if (isDraggingLeft) { newItemLeft.x = x + offsetXLeft; newItemLeft.y = y + offsetYLeft; itemPlaceLeft.x = newItemLeft.x; itemPlaceLeft.y = newItemLeft.y + itemPlaceLeft.height / 2 - 86; } }; newItemLeft.up = function (x, y, obj) { isDraggingLeft = false; }; if (newItemLeft.Type === 1) { itemPlaceLeft.tint = 0x267f62; newItemLeft.setText(Math.floor(Math.random() * 5 + 3).toString()); } else if (newItemLeft.Type === 2) { itemPlaceLeft.tint = 0xb40421; newItemLeft.setText(Math.floor(Math.random() * 8 + 1).toString()); } else if (newItemLeft.Type === 3) { itemPlaceLeft.tint = 0x272775; newItemLeft.setText('2'); } else if (newItemLeft.Type === 4) { itemPlaceLeft.tint = 0x174F3C; newItemLeft.setText(Math.floor(Math.random() * 6 + 3).toString()); } var itemPlaceRight = LK.getAsset('ItemPlace', { anchorX: 0.5, anchorY: 1, x: 2048 / 2 + 415, // 415 pixels to the right y: painterBackground.y - painterBackground.height / 2 + 360, width: 282, height: 282, alpha: 1, tint: 0xb40421 }); game.addChild(itemPlaceRight); var newItemRight = new Text2('3', { size: 170, fill: 0xFFFFFF, font: "Arial Black" }); newItemRight.Type = function () { var rand = Math.random(); if (rand < 0.34) { return 1; } // 34% chance if (rand < 0.68) { return 2; } // 34% chance if (rand < 0.84) { return 3; } // 16% chance return 4; // 16% chance }(); newItemRight.anchor.set(0.5, 1); newItemRight.x = itemPlaceRight.x; newItemRight.y = itemPlaceRight.y - itemPlaceRight.height / 2 + 86; // Moved 11 pixels lower game.addChild(newItemRight); // Variables to track dragging state var isDraggingRight = false; var offsetXRight, offsetYRight; // Add event listeners for dragging NewItemRight and its ItemPlace newItemRight.down = function (x, y, obj) { isDraggingRight = true; offsetXRight = newItemRight.x - x; offsetYRight = newItemRight.y - y; // Removed preventDefault call as it causes TypeError }; newItemRight.move = function (x, y, obj) { if (isDraggingRight) { newItemRight.x = x + offsetXRight; newItemRight.y = y + offsetYRight; itemPlaceRight.x = newItemRight.x; itemPlaceRight.y = newItemRight.y + itemPlaceRight.height / 2 - 86; } }; newItemRight.up = function (x, y, obj) { isDraggingRight = false; }; if (newItemRight.Type === 1) { itemPlaceRight.tint = 0x267f62; newItemRight.setText(Math.floor(Math.random() * 5 + 3).toString()); } else if (newItemRight.Type === 2) { itemPlaceRight.tint = 0xb40421; newItemRight.setText(Math.floor(Math.random() * 8 + 1).toString()); } else if (newItemRight.Type === 3) { itemPlaceRight.tint = 0xe07400; newItemRight.setText('2'); } else if (newItemRight.Type === 4) { itemPlaceRight.tint = 0x174F3C; newItemRight.setText(Math.floor(Math.random() * 6 + 3).toString()); } // Generate String Of Numbers var randomNumberTexts = []; for (var i = 0; i < 50; i++) { // Create a new Text2 object to display the random number var randomNumberText = new Text2(Math.floor(Math.random() * 10).toString(), { size: 40, fill: 0x4A73B5, font: "Courier New" }); randomNumberText.anchor.set(0.5, 0.5); randomNumberText.x = 2048 / 50 * i; randomNumberText.y = 2732 / 2 + 930; game.addChild(randomNumberText); randomNumberTexts.push(randomNumberText); } // Add an update function to the game to move the numbers to the left game.update = function () { for (var i = 0; i < randomNumberTexts.length; i++) { randomNumberTexts[i].x -= 5; if (randomNumberTexts[i].x < 0) { randomNumberTexts[i].x = 2048; } } }; // Add brown board to the game var brownBoardWidth = 400; // Define the width of the BrownBoard asset var brownBoardHeight = 400; // Define the height of the BrownBoard asset var brownBoard = LK.getAsset('BrownBoard', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2 - 30, scaleX: 2048 / brownBoardWidth, scaleY: (6 / 1.5 * 1.1 * 1.1 * 0.95 * brownBoardHeight + 30) / brownBoardHeight, alpha: 1 }); // Add main background to the game var background = LK.getAsset('Background', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2 + 20, y: 2732 / 2, width: 2068 * 1.05, height: 2000, alpha: 1 }); game.addChild(brownBoard); game.addChild(background); // Add gridBack behind the grid, but above Background var gridBack = LK.getAsset('GridBack', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2 - 5, y: 2732 / 2 - 20, width: 1400 * 1.2 + 5, height: 1400 * 1.1 * 1.1 - 10, alpha: 1 }); game.addChild(gridBack); // Initialize a 7x7 grid of SquareWhite in the middle of the screen var grid = []; var gridSize = 6; var squareSize = 225.28 * 1.08 * 1.08 * 1.05; // Increase the size of the grid by an additional 5% var startX = (2048 - gridSize * squareSize) / 2 + 110 + 20; var startY = (2732 - gridSize * squareSize) / 2 + 90 + 20 + 5; for (var i = 0; i < gridSize; i++) { for (var j = 0; j < gridSize; j++) { var square = LK.getAsset('SquareWhite', { anchorX: 0.5, anchorY: 0.5, x: startX + i * squareSize, y: startY + j * squareSize, scaleX: 2.112 * 1.08 * 1.05 * 1.08 * 1.05, // Increase the size by an additional 5% scaleY: 2.112 * 1.08 * 1.05 * 1.08 * 1.05, // Increase the size by an additional 5% alpha: 1, tint: 0xe4ebf0 }); square.Filled = 0; // Removed the ability to click on SquareWhite to remove it game.addChild(square); grid.push(square); } } // Create 6 WhiteCircle instances and stack them on top of each other in the middle of the screen for (var i = 0; i < 6; i++) { var whiteCircle = LK.getAsset('WhiteCircle', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2 - 910, y: 2732 / 2 + i * 300 - 730 - 20 - 5, width: 31.5, height: 31.5, tint: 0x34dbeb }); game.addChild(whiteCircle); // Add a randomiser to change the brightness of each WhiteCircle every 1-5 seconds (function (whiteCircle) { var _changeBrightness = function changeBrightness() { var randomTime = Math.random() * 5000 + 3000; // Random time between 3-8 seconds whiteCircle.alpha = 0.2; // Change brightness to 20% LK.setTimeout(function () { whiteCircle.alpha = 1; // Revert brightness back LK.setTimeout(_changeBrightness, randomTime); // Schedule next brightness change }, randomTime); }; _changeBrightness(); // Start changing brightness })(whiteCircle); } // Add score on top of the screen var scoreTxt = new Text2('0', { size: 160, fill: 0x67BAEB, font: "Courier New" }); // Set score to 0 LK.setScore(0); scoreTxt.setText(LK.getScore()); scoreTxt.anchor.set(0.5, 0); scoreTxt.y += 9; LK.gui.top.addChild(scoreTxt); // Add LevelCounter text 200 pixels under Score var levelCounterTxt = new Text2('Goal: 30', { size: 65, fill: 0xb6bcd6, font: "Courier New" }); levelCounterTxt.anchor.set(0.5, 0); levelCounterTxt.y = scoreTxt.y + 170; LK.gui.top.addChild(levelCounterTxt); for (var i = 0; i < 6; i++) { var rectangle = game.addChild(new WhiteRectangle()); rectangle.x = 2048 - rectangle.width / 2 + 20 - 15; // Move to the right side of the screen and 20 pixels more to the right, then move 15 pixels to the left rectangle.y = i * (rectangle.height + 10) + 945; // Move 945 pixels lower } ;
===================================================================
--- original.js
+++ change.js
@@ -295,9 +295,9 @@
} else if (newItemRight.Type === 2) {
itemPlaceRight.tint = 0xb40421;
newItemRight.setText(Math.floor(Math.random() * 8 + 1).toString());
} else if (newItemRight.Type === 3) {
- itemPlaceRight.tint = 0x272775;
+ itemPlaceRight.tint = 0xe07400;
newItemRight.setText('2');
} else if (newItemRight.Type === 4) {
itemPlaceRight.tint = 0x174F3C;
newItemRight.setText(Math.floor(Math.random() * 6 + 3).toString());
square with Neon dark blue borders, simple, futuristic, 2d. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Sci-fi Vault dark Concrete wall texture 2d. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Scifi Square with thin, rounded corners. Dark grey. 2d. Single Game Texture. Little blue outline
Smooth white circle, 2d, simple. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Rounded white square. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.