Code edit (1 edits merged)
Please save this source code
Code edit (22 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught ReferenceError: center is not defined' in or related to this line: 'var instructionsTxt = new Text2('Welcome to space, traveler!\nTap to collect the color indicated below.', {' Line Number: 426
Code edit (1 edits merged)
Please save this source code
Code edit (12 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Error: The supplied index is out of bounds' in or related to this line: 'game.setChildIndex(counter, game.children.length);' Line Number: 249
Code edit (9 edits merged)
Please save this source code
User prompt
can you update this line, so it updates the textlabel with the new value
Code edit (1 edits merged)
Please save this source code
Code edit (18 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught ReferenceError: sel is not defined' in or related to this line: 'self.x = sel.x;' Line Number: 24
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 (2 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: particleGraphics is not defined' in or related to this line: 'if (particleGraphics.alpha <= 0) {' Line Number: 247
Code edit (1 edits merged)
Please save this source code
Code edit (5 edits merged)
Please save this source code
User prompt
please implement it that way
Code edit (5 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: movetype is not defined' in or related to this line: 'if (movetype == 0) {' Line Number: 119
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 (12 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -109,16 +109,26 @@
};
self.on('down', function (obj) {
// If player clicked the right color.
if (self.getChildAt(0).tint == currentPalette[currentRightColor]) {
+ // Increment score.
score++;
- if (currentRightColor++ == currentPalette.length) {
- //TODO: Change to new palette.
+ scoreTxt.setText(score);
+ LK.setScore(score);
+ if (++currentRightColor == currentPalette.length) {
+ // Change to new palette.
+ allPalettesCounter++;
+ if (allPalettesCounter == allPalettes.length) {
+ allPalettesCounter = 0;
+ }
+ currentPalette = allPalettes[allPalettesCounter];
+ currentRightColor = 0;
+ selector.init(0);
} else {
//TODO: Change to next color on palette.
+ selector.init(currentRightColor);
}
- //TODO: Re-init this star.
- //this.init();
+ // Re-init this star.
self.x = -50000;
} else {
console.log('wrong');
}
@@ -182,8 +192,11 @@
var galacticGreen = ["0xe8f1a6", "0xcad670", "0xa3c255", "0x6fa341", "0x498f45", "0x387450", "0x2d5c56", "0x1f3741", "0x1e2029", "0x16161c"];
var berryNebula = ["0x6ceded", "0x6cb9c9", "0x6d85a5", "0x6e5181", "0x6f1d5c", "0x4f1446", "0x2e0a30", "0x0d001a"];
var currentPalette = berryNebula;
game.setBackgroundColor(currentPalette[currentPalette.length - 1]);
+// Since game changes between palettes as we progress, we keep the different palettes in an array and have a counter for which one we're current using.
+var allPalettesCounter = 0;
+var allPalettes = [berryNebula, galacticGreen];
/*
// Create a text label with a warning message
var warningTxt = new Text2('Captain?! Please confirm order to keep accelerating!?\nWe are approaching very dangerous speeds!\nAnd where the HELL are we actually going?', {
size: 75,
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.