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
@@ -7,20 +7,24 @@
size: 100,
fill: "#ffffff",
anchorX: 0.5,
anchorY: 0,
- align: 'center'
+ weight: 800,
+ dropShadow: true,
+ dropShadowColor: '#000000',
+ dropShadowAngle: Math.PI / 6,
+ dropShadowDistance: 5
});
self.val = counterMax;
self.addChild(txt);
self.init = function (index) {
//var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
//self.width = game.width / (currentPalette.length - 1) / 2;
//self.height = self.width / 2;
- self.x = selector.x + 50;
- self.y = game.height - 450;
self.val = counterMax;
txt.setText('' + self.val);
+ self.x = selector.x + 50;
+ self.y = game.height - 430;
};
self.update = function () {
self.val -= 1;
txt.setText('' + self.val);
@@ -55,21 +59,10 @@
});
/*
TODOS:
======
-- Determine game over conditions
-* Time based per palette (based on number of colors in it)? Yes, place a countdown timer on the active palette color.
- If it reaches 0 before that color has been clicked, game over.
-* Number of misclicks?
- Write instructions on game start.
-- Game gets visually exhausting after some time. Maybe there should be a status screen once in a while, just to break it up?
- Maybe, once a color has been clicked/tapped, stars should stop spawning in that color for remainder of the level?
-- Maybe show the name of each palette used?
-- Maybe show game title on top, above score?
-- Brainstorm for game title: color space, colorful space, colorful universe, luniverse, loonyverse, star catcher,
-planet catcher, sort the universe, planet sorting, Lala Universe, universal palettes, Colorvoid, Color Void,
-Beauty-verse, Space Splatter, Basket Case Balls, Everything is Round, What Goes Around, Unruly Universe, Pesky Galaxies,
-Noli Turbare, Multiverse Explorer, Basket No Ball
*/
var Selector = Container.expand(function () {
var self = Container.call(this);
var selectorGraphics = self.attachAsset('selector', {
@@ -407,41 +400,55 @@
initSquares();
var selector = new Selector();
selector.init(0);
game.addChild(selector);
-var counterMax = 10;
+var counterMax = 15;
var counter = new Counter();
counter.init(selector);
game.addChild(counter);
var currentRightColor = 0;
var score = 0;
+var gameStarted = false;
// Score display
var scoreTxt = new Text2('0', {
- size: 100,
+ weight: 800,
+ size: 120,
fill: "#ffffff",
anchorX: 0.5
});
LK.gui.top.addChild(scoreTxt);
+var instructionsTxt = new Text2('Welcome to space, traveler!\nTap to collect the color indicated below.', {
+ weight: 800,
+ size: 100,
+ fill: "#ffffff",
+ anchorX: 0.5,
+ align: 'center'
+});
+instructionsTxt.x = 0; //game.width / 2;
+instructionsTxt.y = game.height / 2 - 300;
+game.addChild(instructionsTxt);
// Drag character
// Game tick
LK.on('tick', function () {
//console.log(particles.length);
- stars.forEach(function (star, index) {
- star.move();
- });
- //console.log(LK.ticks);
- if (LK.ticks > 0 && LK.ticks % 100 == 0) {
- counter.update();
- }
- particles.forEach(function (particle, index) {
- particle.move();
- if (particle.alpha <= 0 || particle.y > game.height - 200) {
- particles.splice(index, 1);
- particle.destroy();
+ if (gameStarted) {
+ stars.forEach(function (star, index) {
+ star.move();
+ });
+ //console.log(LK.ticks);
+ if (LK.ticks > 0 && LK.ticks % 100 == 0) {
+ counter.update();
}
- });
- if (tweenProgress < tweenDuration) {
- centerX += (targetX - centerX) / (tweenDuration - tweenProgress);
- centerY += (targetY - centerY) / (tweenDuration - tweenProgress);
- tweenProgress++;
+ particles.forEach(function (particle, index) {
+ particle.move();
+ if (particle.alpha <= 0 || particle.y > game.height - 200) {
+ particles.splice(index, 1);
+ particle.destroy();
+ }
+ });
+ if (tweenProgress < tweenDuration) {
+ centerX += (targetX - centerX) / (tweenDuration - tweenProgress);
+ centerY += (targetY - centerY) / (tweenDuration - tweenProgress);
+ tweenProgress++;
+ }
}
});
\ No newline at end of file
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.