User prompt
change cubeGraphics Tint when colorBox selection changes and update display
User prompt
add a grid with 8 selectable tini colors that allow the cubeGraphics tint to be changes when clicked
Code edit (5 edits merged)
Please save this source code
User prompt
add a tint color to cubeGraphics
User prompt
add a full screen background image
Code edit (3 edits merged)
Please save this source code
User prompt
update speeddisplay when speed changes
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'setText')' in this line: 'speedDisplay.setText('Speed: ' + self.value);' Line Number: 9
User prompt
Fix Bug: 'ReferenceError: speedDisplay is not defined' in this line: 'speedDisplay.setText('Speed: ' + self.value);' Line Number: 9
User prompt
Fix Bug: 'TypeError: LK.gui.topCenter.setText is not a function' in this line: 'LK.gui.topCenter.setText('Speed: ' + self.value);' Line Number: 9
User prompt
Display speed setting
User prompt
ad a sliding drop speed selector to right hand side that goes from 1 to 10 and use value for speed
User prompt
add condition that if intersection with cube is on side then stack to the side
User prompt
remove banner
Code edit (2 edits merged)
Please save this source code
User prompt
add scale to leftbutton
Code edit (1 edits merged)
Please save this source code
Code edit (2 edits merged)
Please save this source code
User prompt
add a 500-pixel banner across top of screen
User prompt
add condition if stack reaches top of screen then stop
User prompt
rotate left hand button image 180 degrees
User prompt
flip left hand arrow image on the vertical
User prompt
Fix Bug: 'ReferenceError: cubeColor is not defined' in this line: 'newCube.color = cubeColor;' Line Number: 49
User prompt
add a grind at top of screen showing 8 hues of tint for cube colour that can be selected
User prompt
add button to stop/start cube falling
===================================================================
--- original.js
+++ change.js
@@ -11,18 +11,33 @@
self.x += 10;
}
}
};
- self.stack = function (otherCube) {
+ self.stack = function (otherCube, intersection) {
if (otherCube) {
- self.y = otherCube.y - self.height;
+ if (intersection === 'side') {
+ if (self.x < otherCube.x) {
+ self.x = otherCube.x - self.width;
+ } else {
+ self.x = otherCube.x + otherCube.width;
+ }
+ } else {
+ self.y = otherCube.y - self.height;
+ }
} else if (self.y + self.height >= 2732) {
self.y = 2732 - self.height;
}
self.speed = 0;
};
self.intersectsWith = function (otherCube) {
- return self.x < otherCube.x + otherCube.width && self.x + self.width > otherCube.x && self.y < otherCube.y + otherCube.height && self.y + self.height > otherCube.y;
+ var intersects = self.x < otherCube.x + otherCube.width && self.x + self.width > otherCube.x && self.y < otherCube.y + otherCube.height && self.y + self.height > otherCube.y;
+ if (intersects) {
+ if (self.x + self.width - otherCube.x < 10 || otherCube.x + otherCube.width - self.x < 10) {
+ return 'side';
+ }
+ return 'top';
+ }
+ return false;
};
});
var Game = Container.expand(function () {
var self = Container.call(this);
@@ -86,10 +101,11 @@
cubes[i].move(moveDirection);
}
var stacked = false;
for (var j = 0; j < cubes.length; j++) {
- if (i != j && cubes[i].intersectsWith(cubes[j])) {
- cubes[i].stack(cubes[j]);
+ var intersection = cubes[i].intersectsWith(cubes[j]);
+ if (i != j && intersection) {
+ cubes[i].stack(cubes[j], intersection);
stacked = true;
break;
}
}
arrow pointing left, transparent background, cartoon style, no shadow Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
white square, 2d in-game asset, blank background, high contrast, no shadows, single game texture Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
vertical slider. 1000 pixels tall and 50 pixels wide. with numbers 1 at top and 10 at bottom. 2d in-game asset. blank background no shadows. high contrast Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
white square, 2d in-game asset, blank background, high contrast, no shadows, single game texture Single Game Texture. With word DROP in middle Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
background image 2732 high x 2048 wide. high contrast, light cartoon image of colored stacked cubes. out in open fields. Single Game Texture. In-Game asset. 3d. High contrast. No shadows. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
stone square, bevelled edges. 2d in-game asset, blank background, high contrast, no shadows, single-game texture. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Triangle pointing left, transparent background, cartoon style, no shadow Single Game Texture. In-Game asset. 2d. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.