User prompt
Move all WhiteCircles 15 pixels higher
User prompt
make ScoreBack 20% wider, keep center the same
User prompt
move it down 4 pixels
User prompt
Move Score 10 pixels up
User prompt
Okay. Change score's font size to 160
User prompt
Change font of string of numbers to Courier New
User prompt
Change Score's font to Courier New
User prompt
Set font color for score ONLY to #67baeb
User prompt
Change it to #3d568f
User prompt
Set font color for string of numbers to #3f66bf
User prompt
Only generate 6 White Circles
Code edit (1 edits merged)
Please save this source code
User prompt
Add very small blue tint to ConcreteBackground
User prompt
Randomize score from 1000 to 9999 every 4 seconds
User prompt
Move whiteRectangles 15 pixels to the left
User prompt
5 pixels lower
User prompt
Move WhiteRectangles 60 pixels higher
User prompt
Generate 7 whiteRectangles instead of 6
User prompt
Move white rectangles 300 pixels lower
User prompt
Increase height of WhiteRectangles by 2 times
Code edit (1 edits merged)
Please save this source code
User prompt
Okay. I want it to be first the BrownBoard, then the string of numbers, then the Background
User prompt
Make brownBoard 5% smaller
User prompt
Make BrownBoard 5% taller
User prompt
Move brown Board 20 pixels lower
/**** * 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.35); // Increase the height by 40% // 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 ****/ // Create an array to hold the random numbers var randomNumbers = []; // Generate the first random number and add it to the array var firstNumber = Math.floor(Math.random() * 10); randomNumbers.push(firstNumber); // Generate 99 more random numbers and add them to the array for (var i = 0; i < 99; i++) { var randomNumber = Math.floor(Math.random() * 10); randomNumbers.push(randomNumber); } // Create a Text2 object to display the random numbers var numbersText = new Text2(randomNumbers.join(''), { size: 40, // Reduced the font size by 20% fill: "#89CFF0" }); // Position the text at the left side of the screen numbersText.x = 0; numbersText.y = game.height / 2 + 900; // Add the text to the game game.addChild(numbersText); // Create an update function to move the numbers to the left game.update = function () { // Move the numbers to the left numbersText.x -= 5; // If the first number goes off-screen if (numbersText.x + numbersText.width < 0) { // Remove the first number from the array randomNumbers.shift(); // Reset the position of the text to the right side of the screen numbersText.x = game.width; } }; // 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 }); game.addChildAt(concreteBackground, 0); // 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); // Initialize an 8x8 grid of SquareWhite in the middle of the screen var grid = []; var gridSize = 8; var squareSize = 225.28 * 0.95; // Reduce the size of the grid by 5% var startX = (2048 - gridSize * squareSize) / 2 + 110; var startY = (2732 - gridSize * squareSize) / 2 + 90; 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.03, scaleY: 2.112 * 1.03 }); square.down = function (x, y, obj) { this.destroy(); }; 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, width: 31.5, height: 31.5, tint: 0xCCCCCC }); 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 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, // Reduced the font size by 10% fill: "#ffffff", font: "Helvetica" }); var scoreBack = LK.getAsset('ScoreBack', { anchorX: 0.5, anchorY: 0.5, x: scoreTxt.x + 5, y: 20 + 75 - 35 + 20, width: 2048 / 3 * 0.85 * 0.85, // Reduce the width by 15% again height: 150 * 1.3 * 1.3 * 1.4 * 1.2 * 0.85, // Reduce the height by 15% alpha: 1 }); LK.gui.top.addChild(scoreBack); // Add score on top of the screen var scoreTxt = new Text2('0', { size: 135, // Reduced the font size by 10% fill: "#89CFF0", font: "Helvetica" }); LK.setScore(9999); scoreTxt.setText(LK.getScore()); scoreTxt.anchor.set(0.5, 0); scoreTxt.y += 15; LK.gui.top.addChild(scoreTxt); for (var i = 0; i < 6; i++) { var rectangle = game.addChild(new WhiteRectangle()); rectangle.x = 2048 - rectangle.width / 2 + 20; // Move to the right side of the screen and 20 pixels more to the right rectangle.y = i * (rectangle.height + 10) + 700; // Move 700 pixels lower } ;
===================================================================
--- original.js
+++ change.js
@@ -1,38 +1,39 @@
/****
+* 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.35); // Increase the height by 40%
+ // 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
****/
-// 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
-});
-game.addChildAt(concreteBackground, 0);
-// 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 - 10,
- scaleX: 2048 / brownBoardWidth * 0.95,
- scaleY: (6 / 1.5 * 1.1 * 1.1 * 0.95 * brownBoardHeight + 30) / brownBoardHeight * 1.05 * 0.95,
- alpha: 1
-});
// Create an array to hold the random numbers
var randomNumbers = [];
// Generate the first random number and add it to the array
var firstNumber = Math.floor(Math.random() * 10);
@@ -64,9 +65,31 @@
// Reset the position of the text to the right side of the screen
numbersText.x = game.width;
}
};
-game.addChild(brownBoard);
+// 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
+});
+game.addChildAt(concreteBackground, 0);
+// 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,
@@ -75,8 +98,9 @@
width: 2068 * 1.05,
height: 2000,
alpha: 1
});
+game.addChild(brownBoard);
game.addChild(background);
// Initialize an 8x8 grid of SquareWhite in the middle of the screen
var grid = [];
var gridSize = 8;
@@ -156,5 +180,10 @@
scoreTxt.setText(LK.getScore());
scoreTxt.anchor.set(0.5, 0);
scoreTxt.y += 15;
LK.gui.top.addChild(scoreTxt);
+for (var i = 0; i < 6; i++) {
+ var rectangle = game.addChild(new WhiteRectangle());
+ rectangle.x = 2048 - rectangle.width / 2 + 20; // Move to the right side of the screen and 20 pixels more to the right
+ rectangle.y = i * (rectangle.height + 10) + 700; // Move 700 pixels lower
+}
;
\ No newline at end of file
Rounded square with fog inside it. Simplistic. Single Game Texture. In-Game asset. 2d. Blank background. Low contrast. No shadows.
square with Neon dark blue borders, simple, cyberpunk, 2d. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
square with Neon dark blue borders, simple, futuristic, 2d. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Light blue Circle Light 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.
Arrow "backwards" or "undo". White arrow, no background, 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
White triangle with sharp edges. White fill, thin outline, 2d, no shadows, blank background. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.