User prompt
Generate ScoreBack before Background is generated, but after ConcreteBackground is generated, by changing the source doe
Code edit (1 edits merged)
Please save this source code
User prompt
set alll text color to 4A73B5
User prompt
Place ScoreBack inbetween ConcreteBackground and Background by editing source code
User prompt
Make Scoreback extra 30%taller
User prompt
Make ScoreBack 20% taller and Place ScoreBack Behind Background
User prompt
Make ScoreBack 20% taller
User prompt
Generate ScoreBack after generation of ConcrereBackground
User prompt
Make ScoreBack 20% taller, move it 100 pixels lower
User prompt
Move EVERYTHING except for Score, ScoreBack and ConcreteBackground by 130 pixels up
User prompt
Make PainterBackground 10% thinner, move it additional 5 pixels lower
User prompt
Move Painter Background 15 pixels lower, and change its width to be 5% thinner
User prompt
Generate String Of Numbers after PainterBackground by moving source code
User prompt
Make PainterBackground 800 pixels tall
User prompt
Make PainterBackground 10% taller and move it 15 pixels higher
User prompt
Make PainterBackground 10% thinner and 10% taller
User prompt
Place PainterBackground at the bottom of the screen, above ConcreteBackground
Code edit (1 edits merged)
Please save this source code
User prompt
Move all WhiteCircles 5 pixels up
User prompt
Move Text2 30 pixels lower
Code edit (1 edits merged)
Please save this source code
User prompt
With string of numbers, re-write the code so when the string touches left side of the screen, a new string is added at the right side of the screen
User prompt
Change string of numbers font color to #4a73b5
User prompt
Another 5 pixels higher
User prompt
Move all WhiteCircles 15 pixels higher
/****
* 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: "#4a73b5",
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 PainterBackground at the bottom of the screen, above ConcreteBackground
var painterBackground = LK.getAsset('PainterBackground', {
anchorX: 0.5,
anchorY: 1,
x: 2048 / 2,
y: 2732,
width: 2048 * 0.9,
// 10% thinner
height: 2732 / 10 * 1.1,
// 10% taller
alpha: 1
});
game.addChild(painterBackground);
// 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 - 20 - 5,
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,
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 * 1.2,
height: 150 * 1.3 * 1.3 * 1.4 * 1.2 * 0.85,
alpha: 1
});
LK.gui.top.addChild(scoreBack);
// Add score on top of the screen
var scoreTxt = new Text2('0', {
size: 160,
fill: "#67baeb",
font: "Courier New"
});
// Create a timer to randomize score every 4 seconds
LK.setInterval(function () {
var randomScore = Math.floor(Math.random() * (9999 - 1000 + 1)) + 1000;
LK.setScore(randomScore);
scoreTxt.setText(LK.getScore());
}, 4000);
scoreTxt.anchor.set(0.5, 0);
scoreTxt.y += 9;
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 - 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
@@ -73,10 +73,12 @@
anchorX: 0.5,
anchorY: 1,
x: 2048 / 2,
y: 2732,
- width: 2048,
- height: 2732 / 10,
+ width: 2048 * 0.9,
+ // 10% thinner
+ height: 2732 / 10 * 1.1,
+ // 10% taller
alpha: 1
});
game.addChild(painterBackground);
// Add brown board to the game
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.