Code edit (11 edits merged)
Please save this source code
User prompt
also make the dragged item highest depth
User prompt
fix my code so that the draggable functionality works
Code edit (9 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: Cannot set properties of undefined (setting 'tint')' in or related to this line: 't.starGraphics.tint = collection[i].c;' Line Number: 469
Code edit (1 edits merged)
Please save this source code
Code edit (6 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot set properties of undefined (setting 'alpha')' in or related to this line: 'score.text.alpha = 0;' Line Number: 468
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (8 edits merged)
Please save this source code
User prompt
please write that function as a standalone function to be called from within the star's current move function
Code edit (1 edits merged)
Please save this source code
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
===================================================================
--- original.js
+++ change.js
@@ -37,9 +37,10 @@
txt.x = 0;
}
//self.x = selector.x;
if (self.val <= 0) {
- LK.showGameOver();
+ //LK.showGameOver();
+ goToPainting();
}
};
});
var GameLogo = Container.expand(function () {
@@ -187,9 +188,9 @@
//var moveType = (movementTypeSelectorOffset + allPalettesCounter) % 5;
/*if (currentPalette == matriax8c && score != 0) {
moveType == 3;
}*/
- if (moveType == 4) {
+ if (moveType == 0) {
self.x = centerX + self.vx * self.z;
self.y = centerY + self.vy * self.z;
} else if (moveType == 1) {
self.x = centerX + self.vx * self.z;
@@ -199,9 +200,9 @@
self.y = centerY + self.vy * self.z;
} else if (moveType == 3) {
self.x = centerX + Math.sin(self.z / 10000) * self.vx * self.z;
self.y = centerY + Math.cos(self.z / 10000) * self.vy * self.z;
- } else if (moveType == 0) {
+ } else if (moveType == 4) {
// Calculate the direction vector from the center to the star
var dx = self.x - centerX;
var dy = self.y - centerY;
// Normalize the direction vector
@@ -236,8 +237,13 @@
// Increment score.
score++;
scoreTxt.setText(score);
LK.setScore(score);
+ collection.push({
+ w: self.width,
+ c: currentPalette[currentRightColor]
+ });
+ console.log(collection);
// Trigger radial particle explosion
createRadialExplosion(self.x, self.y);
if (++currentRightColor == currentPalette.length - 1) {
// Change to new palette.
@@ -275,9 +281,9 @@
//console.log(game.getChildByName('selector').getDepth());
// Re-init this star.
self.x = -50000;
} else {
- console.log('wrong');
+ //console.log('wrong');
// TODO: Game over or life lost?
}
});
});
@@ -444,8 +450,18 @@
squares.push(square);
game.addChild(square);
}*/
initSquares();
+var collection = [];
+var goToPainting = function goToPainting() {
+ for (var i = 0; i < collection.length - 1; i++) {
+ var t = new Particle();
+ t.init(Math.random() * game.width, Math.random() * game.height, 0, 0, 1); //x, y, vx, vy, scale
+ t.width = collection[i].w;
+ t.height = t.width;
+ t.getChildAt(0).tint = collection[i].c;
+ }
+};
var selector = new Selector();
selector.init(0);
game.addChild(selector);
var counterMax = 15;
@@ -466,9 +482,9 @@
LK.gui.top.addChild(scoreTxt);
var gameLogo = game.addChild(new GameLogo());
gameLogo.x = game.width / 2;
gameLogo.y = 700;
-var instructionsTxt = new Text2("Welcome to colorful space!\n\nWe'll be collecting colors from all\nof the galaxies.\n\nTap a planet of the color indicated below\nto get started.", {
+var instructionsTxt = new Text2("Welcome to colorful outer space!\n\nWe'll be collecting colors from all\nof the galaxies.\n\nSpace is endless - how far you can get?\n\nTap a planet of the color indicated below\nto get started.", {
weight: 800,
size: 90,
fill: "#ffffff",
anchorX: 0.5,
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.