User prompt
Please fix the bug: 'Uncaught ReferenceError: addPathStep is not defined' in or related to this line: 'addPathStep(1024, 2400 - curStep * 2 * 100);' Line Number: 32
User prompt
Please fix the bug: 'Uncaught TypeError: self.addPathStep is not a function' in or related to this line: 'self.addPathStep(1024, 2400 - curStep * 2 * 100);' Line Number: 32
User prompt
Please fix the bug: 'Uncaught TypeError: self.addPathStep is not a function' in or related to this line: 'self.addPathStep(1024, 2400 - curStep * 2 * 100);' Line Number: 42
Code edit (2 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught ReferenceError: addPathStep is not defined' in or related to this line: 'addPathStep(1024, 2400 - curStep * 2 * 100);' Line Number: 42
Code edit (3 edits merged)
Please save this source code
User prompt
ensure the player balls are always displayed on top of the path steps.
Code edit (2 edits merged)
Please save this source code
User prompt
create a function which add a path step
User prompt
Please fix the bug: 'TypeError: pathSteps.removeIndex is not a function' in or related to this line: 'pathSteps.removeIndex(smallPathStep);' Line Number: 70
User prompt
Please fix the bug: 'ReferenceError: min is not defined' in or related to this line: 'smallPathStep = min(smallPathStep, i);' Line Number: 63
User prompt
Please fix the bug: 'ReferenceError: min is not defined' in or related to this line: 'smallPathStep = min(smallPathStep, i);' Line Number: 59
Code edit (1 edits merged)
Please save this source code
User prompt
when a ball leave a path step, the path step is removed and a new one is spawned at the end of the path.
Code edit (2 edits merged)
Please save this source code
User prompt
when the player click, the rotating ball should be one a path step, else it's gameover.
User prompt
Please fix the bug: 'Uncaught ReferenceError: otherBall is not defined' in or related to this line: 'self.rotateAround(otherBall);' Line Number: 20
Code edit (1 edits merged)
Please save this source code
User prompt
a path is composed by multiple steps, each step is displayed as a square and is separate by 2 * ball width.
Code edit (1 edits merged)
Please save this source code
User prompt
increase resolution of the background
User prompt
add a background
User prompt
the balls should have different assets.
Code edit (1 edits merged)
Please save this source code
User prompt
the balls sprites should rotate themself to watch the other ball.
===================================================================
--- original.js
+++ change.js
@@ -8,14 +8,8 @@
self.attachAsset('playerBall1', {
anchorX: 0.5,
anchorY: 0.5
});
- self.rotate = function () {
- if (self.rotating) {
- self.angle += 0.05;
- self.rotation = self.angle;
- }
- };
});
var Player = Container.expand(function () {
var self = Container.call(this);
var ball1 = self.addChild(new Ball());
@@ -35,10 +29,17 @@
ball2.angle = Math.atan2(ball2.y - ball1.y, ball2.x - ball1.x);
}
};
self.rotate = function () {
- ball1.rotate();
- ball2.rotate();
+ if (ball1.rotating) {
+ ball1.rotation = ball1.angle += 0.05;
+ ball1.x = ball2.x + ball2.width * 2 * Math.cos(ball1.angle);
+ ball1.y = ball2.y + ball2.width * 2 * Math.sin(ball1.angle);
+ } else if (ball2.rotating) {
+ ball2.angle += 0.05;
+ ball2.x = ball1.x + ball1.width * 2 * Math.cos(ball2.angle);
+ ball2.y = ball1.y + ball1.width * 2 * Math.sin(ball2.angle);
+ }
};
});
/****
@@ -50,11 +51,11 @@
/****
* Game Code
****/
-// Initialize background stars
-// Initialize obstacle asset
// Initialize player ship asset
+// Initialize obstacle asset
+// Initialize background stars
var player = game.addChild(new Player());
player.x = 1024; // Center horizontally
player.y = 2400; // Position towards the bottom
game.on('down', function (obj) {
tête de mort rouge. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
tête de mort coter droit en bleu coter gauche en rouge. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
tourbillon bleu et rouge. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
bone. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
tourbillon rouge et bleu. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.