User prompt
when the extra point ballon is destroyed; make a text "+100" that moves to the score
User prompt
When the extrapointsballon is destroed, make a small text "+10" that excist for 3 seconds before destroyed
User prompt
Fix Bug: 'TypeError: balloon.hitTest is not a function' in or related to this line: 'if (balloon.hitTest(touchPos)) {' Line Number: 149
User prompt
Fix Bug: 'TypeError: balloon.balloonGraphics.containsPoint is not a function' in or related to this line: 'if (balloon.balloonGraphics.containsPoint(touchPos)) {' Line Number: 149
User prompt
make the balloon draggable
User prompt
Fix Bug: 'TypeError: balloon.hitTest is not a function' in or related to this line: 'if (balloon.hitTest(touchPos)) {' Line Number: 153
User prompt
Fix Bug: 'TypeError: balloon.balloonGraphics.containsPoint is not a function' in or related to this line: 'if (balloon.balloonGraphics.containsPoint(touchPos)) {' Line Number: 153
User prompt
Fix Bug: 'ReferenceError: balloonGraphics is not defined' in or related to this line: 'if (balloonGraphics.containsPoint(touchPos)) {' Line Number: 153
User prompt
Fix Bug: 'TypeError: balloon.containsPoint is not a function' in or related to this line: 'if (balloon.containsPoint(touchPos)) {' Line Number: 153
User prompt
make sure that drag can only be done if down is inside balloon
User prompt
Make the player object draggable when clicked
User prompt
Fix the player ballon, so I can dragg it when I click down on it
User prompt
Fix Bug: 'TypeError: balloon.containsPoint is not a function' in or related to this line: 'if (balloon.containsPoint(touchPos)) {' Line Number: 153
User prompt
initiate movement in the `down` event handler only if the touch starts on the player object. Then, the `move` event handler should update the player object's position as the touch moves, and finally, the `up` event handler should stop the dragging process when the touch ends.
User prompt
Make the player object draggable on the down event
User prompt
For the player object: restrict movement to dragging only, the game should initiate movement in the `down` event handler only if the touch starts on the player object. Then, the `move` event handler should update the player object's position as the touch moves, and finally, the `up` event handler should stop the dragging process when the touch ends. This ensures that the player object only moves when it is being dragged, not when the screen is simply touched.
User prompt
Fix Bug: 'TypeError: balloon.containsPoint is not a function' in or related to this line: 'if (balloon.containsPoint(touchPos)) {' Line Number: 148
User prompt
Fix Bug: 'ReferenceError: balloonGraphics is not defined' in or related to this line: 'if (balloonGraphics.containsPoint(touchPos)) {' Line Number: 148
User prompt
Fix Bug: 'TypeError: balloon.containsPoint is not a function' in or related to this line: 'if (balloon.containsPoint(touchPos)) {' Line Number: 148
User prompt
Fix Bug: 'ReferenceError: balloonGraphics is not defined' in or related to this line: 'if (balloonGraphics.containsPoint(touchPos)) {' Line Number: 148
User prompt
Fix Bug: 'TypeError: balloon.containsPoint is not a function' in or related to this line: 'if (balloon.containsPoint(touchPos)) {' Line Number: 148
User prompt
For the player object: restrict movement to dragging only, the game should initiate movement in the `down` event handler only if the touch starts on the player object. Then, the `move` event handler should update the player object's position as the touch moves, and finally, the `up` event handler should stop the dragging process when the touch ends. This ensures that the player object only moves when it is being dragged, not when the screen is simply touched.
User prompt
make instances of extraPointsBalloon, that moves slowly from left to right, and right to left
User prompt
Fix Bug: 'ReferenceError: ExtraPointsBalloon is not defined' in or related to this line: 'var extraPointsBalloon = new ExtraPointsBalloon();' Line Number: 197
User prompt
make instances of ExtraPointsBalloon, that moves slowly from left to right, and right to left
===================================================================
--- original.js
+++ change.js
@@ -1,20 +1,23 @@
/****
* Classes
****/
-var ScorePopup = Container.expand(function (score, x, y) {
+var ScorePopup = Container.expand(function (initialX, initialY) {
var self = Container.call(this);
- var scoreText = self.attachAsset(new Text2('+' + score, {
+ var scoreText = self.attachAsset(new Text2('+100', {
size: 100,
- fill: "#ffffff",
+ fill: '#ffffff',
anchorX: 0.5,
anchorY: 0.5
}), {});
- self.x = x;
- self.y = y;
- LK.setTimeout(function () {
- self.destroy();
- }, 3000);
+ self.x = initialX;
+ self.y = initialY;
+ self.move = function () {
+ self.y -= 2;
+ if (self.y < 0) {
+ self.destroy();
+ }
+ };
});
// HorizontalExtraPointsBalloon class
var HorizontalExtraPointsBalloon = Container.expand(function () {
var self = Container.call(this);
@@ -231,22 +234,26 @@
}
for (var i = extraPointsBalloons.length - 1; i >= 0; i--) {
extraPointsBalloons[i].move();
if (extraPointsBalloons[i].y > 2732 + extraPointsBalloons[i].height) {
- var popup = new ScorePopup(10, extraPointsBalloons[i].x, extraPointsBalloons[i].y);
- game.addChild(popup);
+ var scorePopup = new ScorePopup(extraPointsBalloons[i].x, extraPointsBalloons[i].y);
+ game.addChild(scorePopup);
extraPointsBalloons[i].destroy();
extraPointsBalloons.splice(i, 1);
} else if (balloon.intersects(extraPointsBalloons[i])) {
score += 10;
extraPointsBalloons[i].destroy();
extraPointsBalloons.splice(i, 1);
}
}
- // Move clouds and update score
+ // Move clouds, score popups, and update score
+ var scorePopups = game.getChildrenByClass(ScorePopup);
for (var c = clouds.length - 1; c >= 0; c--) {
clouds[c].move();
}
+ for (var p = scorePopups.length - 1; p >= 0; p--) {
+ scorePopups[p].move();
+ }
// Increment score by 1 every tick if the game is not over and update the score text
if (!isGameOver) {
score += 1;
scoreTxt.setText(score.toString());
a pixel cloud. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a pixel hot air balloon. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a simpel pixel biplane sideview. Blank background, 2d. No shadows.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a simple red balloon on a string. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a 2d ufo sideview. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.