User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'incrementScore')' in this line: 'self.game.incrementScore();' Line Number: 82
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'incrementScore')' in this line: 'self.game.incrementScore();' Line Number: 82
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'incrementScore')' in this line: 'self.parent.incrementScore();' Line Number: 82
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'incrementScore')' in this line: 'self.game.incrementScore();' Line Number: 82
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'incrementScore')' in this line: 'self.game.incrementScore();' Line Number: 84
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'incrementScore')' in this line: 'self.parent.incrementScore();' Line Number: 84
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'gold')' in this line: 'self.game.gold += 50;' Line Number: 86
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'gold')' in this line: 'self.game.gold += 50;' Line Number: 85
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'gold')' in this line: 'game.gold += 50;' Line Number: 85
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'gold')' in this line: 'self.game.gold += 50;' Line Number: 84
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'scoreTxt')' in this line: 'self.game.scoreTxt.setText(self.game.score.toString());' Line Number: 83
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'scoreTxt')' in this line: 'game.scoreTxt.setText(game.score.toString());' Line Number: 83
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'scoreTxt')' in this line: 'self.game.scoreTxt.setText(self.game.score.toString());' Line Number: 82
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'scoreTxt')' in this line: 'this.game.scoreTxt.setText(this.game.score.toString());' Line Number: 85
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'scoreTxt')' in this line: 'this.game.scoreTxt.setText(this.game.score.toString());' Line Number: 85
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'scoreTxt')' in this line: 'game.scoreTxt.setText(game.score.toString());' Line Number: 85
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'scoreTxt')' in this line: 'self.game.scoreTxt.setText(self.game.score.toString());' Line Number: 84
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'scoreTxt')' in this line: 'game.scoreTxt.setText(game.score.toString());' Line Number: 84
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'scoreTxt')' in this line: 'self.game.scoreTxt.setText(self.game.score.toString());' Line Number: 83
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'incrementScore')' in this line: 'self.game.incrementScore();' Line Number: 82
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'incrementScore')' in this line: 'game.incrementScore();' Line Number: 82
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'incrementScore')' in this line: 'self.game.incrementScore();' Line Number: 81
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'incrementScore')' in this line: 'self.game.incrementScore();' Line Number: 83
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'incrementScore')' in this line: 'self.game.incrementScore();' Line Number: 82
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'incrementScore')' in this line: 'self.game.incrementScore();' Line Number: 82
===================================================================
--- original.js
+++ change.js
@@ -47,9 +47,9 @@
self.cooldown = 30;
self.cooldownTimer = 0;
self.shoot = function (enemies, bulletsContainer) {
if (self.cooldownTimer <= 0 && enemies.length > 0) {
- var bullet = new Bullet(self.game);
+ var bullet = new Bullet(game);
bullet.x = self.x;
bullet.y = self.y;
bulletsContainer.addChild(bullet);
bulletsContainer.bullets.push(bullet);
@@ -60,8 +60,9 @@
});
var Enemy = Container.expand(function () {
var self = Container.call(this);
self.game = game;
+ self.game = game;
var enemyGraphics = self.createAsset('enemy', 'Enemy Graphics', .5, .5);
self.move = function () {
self.y += 2;
if (self.y > 2732) {
@@ -78,9 +79,9 @@
if (self.intersects(enemies[j])) {
enemies[j].destroy();
enemies.splice(j, 1);
self.parent.incrementScore();
- self.game.scoreTxt.setText(self.game.score.toString());
+ game.scoreTxt.setText(game.score.toString());
self.game.gold += 50;
self.destroy();
break;
}
A plain in a comic style with a dirt road with 4 turn staring to top to the botom see from a top and 50 meter high view Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A tower shooting at enemy in a modern style Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A single soldat walking downard in a 16 bit style Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.