Code edit (7 edits merged)
Please save this source code
User prompt
when player taps, remove the instructiontext from gui
Code edit (1 edits merged)
Please save this source code
Code edit (6 edits merged)
Please save this source code
User prompt
Fix Bug: 'Uncaught ReferenceError: center is not defined' in or related to this line: 'var instructionText = new Text2('Tap to jump to the next orbit.\nDon\'t hit the red obstacles.', {' Line Number: 227
Code edit (2 edits merged)
Please save this source code
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'gui')' in or related to this line: 'scoreTxt.LK.gui.top.addChild(scoreTxt);' Line Number: 216
Code edit (4 edits merged)
Please save this source code
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'bottom')' in or related to this line: 'LK.top.bottom.addChild(instructionText);' Line Number: 236
Code edit (6 edits merged)
Please save this source code
User prompt
make sure instructionscreen is visible on stage at start
Code edit (1 edits merged)
Please save this source code
Code edit (19 edits merged)
Please save this source code
User prompt
At start, display white instruction text at screen bottom: "Tap to jump to the next orbit. Don't hit the red obstacles."
Code edit (1 edits merged)
Please save this source code
Code edit (6 edits merged)
Please save this source code
User prompt
Fix Bug: 'Uncaught TypeError: Cannot set properties of undefined (setting 'backgroundColor')' in or related to this line: 'game.set.backgroundColor = rainbowColors[12];' Line Number: 224
Code edit (1 edits merged)
Please save this source code
Code edit (3 edits merged)
Please save this source code
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'parent')' in or related to this line: 'if (obstacles[i].parent) {' Line Number: 276
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'parent')' in or related to this line: 'if (obstacles[i].parent) {' Line Number: 276
Code edit (4 edits merged)
Please save this source code
User prompt
modify ranbowcolors function to only create an array of 30 evenly distributed colors on a seamless rainbow
Code edit (1 edits merged)
Please save this source code
User prompt
Fix Bug: 'Uncaught ReferenceError: i is not defined' in or related to this line: 'var orbitGraphics = self.attachAsset('orbit1', {' Line Number: 89
===================================================================
--- original.js
+++ change.js
@@ -14,8 +14,9 @@
* Every play should start at a different index of the rainbow color wheel.
* Player could be a white dot for max contrast.
* Make check of circular collision, considering actual display size and stage coordinates of obstacles.
* Maybe background should tint with an offset on the colorwheel?
+* rotate orbits instead of calculating obstacle positions.
****/
// Player class
var Player = Container.expand(function () {
var self = Container.call(this);
@@ -90,22 +91,22 @@
//tint: Math.floor(Math.random() * 16777215)
tint: rainbowColors[orbitsCreated % rainbowColors.length]
});
orbitsCreated++;
- orbitGraphics.alpha = 0.6;
+ orbitGraphics.alpha = 0.5;
self.direction = Math.random() < 0.5 ? 1 : -1;
self.positionOrbit = function (i) {
self.x = 2048 / 2;
self.y = 2732 / 2;
this.width = 1900 - i * 500;
this.height = 1900 - i * 500;
if (i !== 0) {
this.numBarriers = 1 + Math.floor(Math.random() * (i + currentOrbitIndex));
- if (this.numBarriers > 20) {
- this.numBarriers = 20;
+ if (this.numBarriers > 12) {
+ this.numBarriers = 12;
}
//self.barrierSpeed = Math.random() * currentOrbitIndex + 1 / 20;
- self.barrierSpeed = 0.01 + Math.random() * 0.02 * self.direction;
+ self.barrierSpeed = 0.01 + Math.random() * 0.015 * self.direction;
for (var j = 0; j < this.numBarriers; j++) {
self.addBarrier(self.barrierSpeed, j);
//console.log('adding barrier: ', j);
}
@@ -113,12 +114,12 @@
};
var orbitGraphicsMask = self.attachAsset('blackSphere', {
anchorX: 0.5,
anchorY: 0.5,
- //tint: 0x000000
- tint: rainbowColors[(orbitsCreated + 3) % rainbowColors.length],
- alpha: 0.05
+ tint: 0x000000
+ //tint: rainbowColors[(orbitsCreated + 1) % rainbowColors.length]
});
+ //orbitGraphicsMask.alpha = 0.1;
orbitGraphicsMask.width = self.width - 200;
orbitGraphicsMask.height = self.height - 200;
self.addBarrier = function (speed, index) {
var barrier = new Obstacle();
@@ -195,9 +196,9 @@
var obstacles = [];
var currentOrbitIndex = 0;
var scaling = false;
var scalingCounter = 0;
-var scalingSpeed = 25; //5;
+var scalingSpeed = 50; //25;
var scalingTarget = 500;
var orbitsCreated = 0;
// Initialize player
var scoreTxt = new Text2('0', {
@@ -214,9 +215,19 @@
orbits.push(orbit);
}
}
createOrbits();
-game.setBackgroundColor(rainbowColors[7] + 0xdddddd);
+// Add instruction text at the bottom of the screen
+var instructionText = new Text2('Tap to jump to the next orbit. Don\'t hit the red obstacles.', {
+ size: 50,
+ fill: "#ffffff",
+ anchorX: 0.5,
+ anchorY: 1
+});
+instructionText.x = 2048 / 2; // Center horizontally
+instructionText.y = 2732; // Position at the bottom
+LK.gui.bottom.addChild(instructionText);
+//game.setBackgroundColor(rainbowColors[7] + 0xdddddd);
player = game.addChild(new Player());
//player.x = 2048 / 2;
//player.y = 2732 / 2 - 200; // Start the player 200px above the center
/*