Code edit (1 edits merged)
Please save this source code
User prompt
tween towards new centerx and centery over 1 second when player taps. use the existing on tick listener
Code edit (1 edits merged)
Please save this source code
User prompt
instead of immediately resetting centerx and centery on down, tween towards it over the next second
User prompt
set the centerX and centerY variables to whereever the player tap on the sreen
Code edit (4 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught ReferenceError: numColors is not defined' in or related to this line: 'for (var i = 0; i < numColors; i++) {' Line Number: 118
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (6 edits merged)
Please save this source code
User prompt
fix it
User prompt
use the rainbowcolors array to set a new color for each star as it is created
Code edit (3 edits merged)
Please save this source code
User prompt
use next value from colorarray when assigning color to a new star
User prompt
colorarray values should be in the 0x?????? format
Code edit (1 edits merged)
Please save this source code
User prompt
write a function to convert rgb color to 0x?????? format
Code edit (2 edits merged)
Please save this source code
User prompt
instead of giving stars random colors, iterate the colorArray to give them successive colors from that array.
User prompt
Please fix the bug: 'ReferenceError: bgColor is not defined' in or related to this line: 'bgColor.r = Math.floor(Math.random() * 256);' Line Number: 113
User prompt
make an array with 200 color values that smoothly transition along a rainbow spectrum
Code edit (8 edits merged)
Please save this source code
User prompt
randomize each color channel separately , rgb
User prompt
instead of yoyo style background color changes, just make values surpassing 00 or FF wrap around, so 00 - 11 becomes FF instead of staying at 00, and ff + 11 becomes 00 instead of staying at ff
===================================================================
--- original.js
+++ change.js
@@ -147,15 +147,9 @@
targetX = pos.x;
targetY = pos.y;
tweenProgress = 0;
});
-LK.on('tick', function () {
- if (tweenProgress < tweenDuration) {
- centerX += (targetX - centerX) / (tweenDuration - tweenProgress);
- centerY += (targetY - centerY) / (tweenDuration - tweenProgress);
- tweenProgress++;
- }
-});
+LK.on('tick', function () {});
var stars = [];
for (var i = 0; i < 1500; i++) {
// Increase star count for denser starfield
var star = new Star();
@@ -172,8 +166,13 @@
LK.gui.top.addChild(scoreTxt);
// Drag character
// Game tick
LK.on('tick', function () {
+ if (tweenProgress < tweenDuration) {
+ centerX += (targetX - centerX) / (tweenDuration - tweenProgress);
+ centerY += (targetY - centerY) / (tweenDuration - tweenProgress);
+ tweenProgress++;
+ }
// Spawn obstacles and stars
// Update tick counter for background color change
/*
colorChangeTick++;
A white triangle pointing down.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A colorful rectangular button with the text "Play Again" with each letter in a different color picked from a nice palette.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.