User prompt
more the score counter to the right 100 pixels
User prompt
more the score counter to the right 300 pixels
User prompt
more the score counter to the right 300 pixels
User prompt
the word score is dissapearing
User prompt
the word score is dissapearing
User prompt
the word score is dissapearing
User prompt
the word score should be on screen at all times
User prompt
fix bug where the word score dissapears
User prompt
move score 300 pixels to the right
User prompt
move player score down to the same height as the bomb counter
User prompt
add the word score: to the player score UI
User prompt
score isn't updating for enemies killed with the bomb
User prompt
player score is not visible on screen
User prompt
show player score on screen
User prompt
Fix Bug: 'ReferenceError: Can't find variable: scoreText' in this line: 'scoreText.setText(self.score.toString());' Line Number: 73
User prompt
Fix Bug: 'TypeError: undefined is not an object (evaluating 'self.score.toString')' in this line: 'var scoreText = new Text2(self.score.toString(), {' Line Number: 285
User prompt
add score - give the player 10 points whenever an enemy is killed
User prompt
Fix Bug: 'ReferenceError: Can't find variable: scoreDisplay' in this line: 'scoreDisplay.setText('Score: ' + self.parent.score.toString());' Line Number: 74
User prompt
the score display is not working
===================================================================
--- original.js
+++ change.js
@@ -69,11 +69,13 @@
enemy.enemyGraphics.scale.x /= 1.2;
enemy.enemyGraphics.scale.y /= 1.2;
if (enemy.enemyGraphics.scale.x < 0.8 || enemy.enemyGraphics.scale.y < 0.8) {
self.parent.enemies.splice(self.parent.enemies.indexOf(enemy), 1);
- self.parent.score += 5;
- self.parent.scoreDisplay.setText('Score: ' + self.parent.score.toString());
+ scoreText.setText(self.score.toString());
enemy.destroy();
+ if (self.parent) {
+ self.parent.score += 10;
+ }
if (self.parent && self.parent.bullets && self.parent.bullets.includes(self)) {
self.parent.bullets.splice(self.parent.bullets.indexOf(self), 1);
self.destroy();
}
@@ -191,10 +193,8 @@
var pickup = bombPickups[i];
if (hero.intersects(pickup)) {
while (self.enemies.length > 0) {
var enemy = self.enemies.pop();
- self.score += 10;
- scoreDisplay.setText('Score: ' + self.score.toString());
enemy.destroy();
}
self.bombCountdown.timeRemaining = 30;
self.bombCountdown.update(0);
@@ -281,27 +281,19 @@
self.stars.push(star);
self.addChild(star);
}
var hero = self.addChild(new Hero());
- var scoreDisplay = new Text2('0', {
+ var scoreText = new Text2(self.score.toString(), {
size: 100,
fill: '#ffffff'
});
- scoreDisplay.anchor.set(0.5, 0);
- scoreDisplay.x = 2048 - scoreDisplay.width / 2;
- scoreDisplay.y = 50;
- LK.gui.topRight.addChild(scoreDisplay);
+ scoreText.anchor.set(0.5, 0);
+ scoreText.x = 2048 / 2;
+ scoreText.y = 20;
+ LK.gui.topCenter.addChild(scoreText);
hero.healthBar = self.addChild(new HealthBar(hero.health, hero.health));
self.enemies = [];
self.score = 0;
- var scoreDisplay = new Text2(self.score.toString(), {
- size: 100,
- fill: '#ffffff'
- });
- scoreDisplay.anchor.set(0.5, 0);
- scoreDisplay.x = 2048 / 2;
- scoreDisplay.y = 50;
- LK.gui.topCenter.addChild(scoreDisplay);
self.healthPickups = [];
self.bombPickups = [];
hero.x = 2048 / 2;
hero.y = 2732 / 2;
amoeba Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Green equilateral triangle, fills the entire picture space in width and height Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
square box viewed from above. White with a large Red Cross Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Purple bomb Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
space image stylised gas clouds, black and white image, low contrast