User prompt
Please fix the bug: 'Timeout.tick error: game.clear is not a function' in or related to this line: 'game.clear(); // Clear all objects from the game' Line Number: 141
User prompt
Please fix the bug: 'TypeError: balloons[i].update is not a function' in or related to this line: 'balloons[i].update();' Line Number: 100
User prompt
Please fix the bug: 'Balloon.extend is not a function' in or related to this line: 'var Balloon2 = Balloon.extend(function () {' Line Number: 60
Code edit (4 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Timeout.tick error: LK.clear is not a function' in or related to this line: 'LK.clear(); // Clear all objects from the game' Line Number: 113
User prompt
Please fix the bug: 'Timeout.tick error: game.clear is not a function' in or related to this line: 'game.clear(); // Clear all objects from the game' Line Number: 113
User prompt
Please fix the bug: 'setInterval is not a function' in or related to this line: 'setTimeout(function () {' Line Number: 121
User prompt
Please fix the bug: 'setInterval is not a function' in or related to this line: 'setInterval(function () {' Line Number: 103
Code edit (1 edits merged)
Please save this source code
Initial prompt
Balloon Hunter
===================================================================
--- original.js
+++ change.js
@@ -36,8 +36,20 @@
// Destroy the balloon
self.destroy();
};
});
+// Balloon2 class for new balloon type
+// Initialize score text
+var Balloon2 = Container.expand(function () {
+ var self = Container.call(this);
+ // Override attach asset for new balloon type
+ self.attachAsset('balloon2', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ // Increase speed for Balloon2
+ self.speed += 1;
+});
/****
* Initialize Game
****/
@@ -48,20 +60,8 @@
/****
* Game Code
****/
-// Balloon2 class for new balloon type
-// Initialize score text
-var Balloon2 = Balloon.extend(function () {
- var self = Balloon.call(this);
- // Override attach asset for new balloon type
- self.attachAsset('balloon2', {
- anchorX: 0.5,
- anchorY: 0.5
- });
- // Increase speed for Balloon2
- self.speed += 1;
-});
var scoreTxt = new Text2('0', {
size: 150,
fill: 0xFFFFFF
});