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
User prompt
set each new orbit on creation to the tint that is the next index in the rainbow colors array.
Code edit (1 edits merged)
Please save this source code
User prompt
Fix Bug: 'Uncaught TypeError: rainbowColors is not a function' in or related to this line: 'var colors = rainbowColors();' Line Number: 189
Code edit (13 edits merged)
Please save this source code
User prompt
Fix Bug: 'Uncaught ReferenceError: utils is not defined' in or related to this line: 'colors.push(utils.rgb2hex(utils.hsv2rgb(hue / 360, 1, 1)));' Line Number: 150
User prompt
make a global variable which is an array containing 60 values representing an even and looping rainbow of colors.
Code edit (6 edits merged)
Please save this source code
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'width')' in or related to this line: 'if (orbits[i].width > 2700) {' Line Number: 216
Code edit (1 edits merged)
Please save this source code
User prompt
Fix Bug: 'ReferenceError: angleSpeed is not defined' in or related to this line: 'self.angle = (self.angle || 0) + angleSpeed;' Line Number: 72
User prompt
Fix Bug: 'ReferenceError: angleSpeed is not defined' in or related to this line: 'self.angle = (self.angle || 0) + angleSpeed;' Line Number: 72
Code edit (1 edits merged)
Please save this source code
Code edit (2 edits merged)
Please save this source code
User prompt
Fix Bug: 'ReferenceError: obstacleGraphics is not defined' in or related to this line: 'barrier.y = self.y + (self.height - obstacleGraphics.height) / 2 * Math.sin(barrier.angle);' Line Number: 109
User prompt
Fix Bug: 'ReferenceError: obstacleGraphics is not defined' in or related to this line: 'barrier.x = self.x + (self.width - obstacleGraphics.width) / 2 * Math.cos(barrier.angle);' Line Number: 108
===================================================================
--- original.js
+++ change.js
@@ -11,8 +11,11 @@
* Current min and max speeds of obstacles should be closer to each other.
* Some rings could contain a single powerup (static, so player would always be able to circle around and get it.)
* Or maybe just no obstacles, as a breather.
* 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?
****/
// Player class
var Player = Container.expand(function () {
var self = Container.call(this);
@@ -175,10 +178,10 @@
return '0x' + toHex(r) + toHex(g) + toHex(b);
}
var rainbowColors = function () {
var colors = [];
- for (var i = 0; i < 30; i++) {
- var hue = i * 12 % 360;
+ for (var i = 0; i < 15; i++) {
+ var hue = i * 24 % 360;
colors.push(hsvToHex(hue / 360, 1, 1));
}
return colors;
}();
@@ -209,8 +212,9 @@
orbits.push(orbit);
}
}
createOrbits();
+game.setBackgroundColor(rainbowColors[12]);
player = game.addChild(new Player());
//player.x = 2048 / 2;
//player.y = 2732 / 2 - 200; // Start the player 200px above the center
/*