User prompt
add score to the game. The player gets 10 points for every enemy killed. Write this score top right of the screen
User prompt
move the bomb counter 100 pixels to the right
User prompt
move the bomb counter 2100 pixels to the right
User prompt
move the bomb counter 200 pixels to the left
User prompt
move the bomb counter 400 pixels to the right
User prompt
move the bomb counter 800 pixels to the left
User prompt
move the bomb counter text slightly to the left
User prompt
move the bomb counter text slightly to the left
User prompt
make sure the bomb count text is visible
User prompt
move bomb counter to left of the screen
User prompt
add text to the bomb counter - it should say 'next bomb in' then the timer
User prompt
the bomb countdown doesn't reset when I trigger a bomb
User prompt
Fix Bug: 'TypeError: undefined is not an object (evaluating 'self.enemyCounter.setText')' in this line: 'self.enemyCounter.setText('0');' Line Number: 194
User prompt
I can't see the bombcountdown
User prompt
create a UI element: a countdown until the next bomb appears
User prompt
remove the visuals for the on-screen enemy counter
User prompt
fix bug in bomb so it only destroys half the on-screen enemies
User prompt
fix bug in bomb so it only destroys half the on-screen enemies
User prompt
Fix Bug: 'TypeError: undefined is not an object (evaluating 'self.parent.enemyCounter.setText')' in this line: 'self.parent.enemyCounter.setText(self.parent.enemies.length.toString());' Line Number: 59
User prompt
remove the on-screen visuals for the enemy counter
User prompt
Fix Bug: 'Timeout.tick error: undefined is not an object (evaluating 'self.enemyCounter.setText')' in this line: 'self.enemyCounter.setText(self.enemies.length.toString());' Line Number: 306
User prompt
remove the graphics for the enemy counter on the top right. don't change any game logic
User prompt
Fix Bug: 'Timeout.tick error: undefined is not an object (evaluating 'self.enemyCounter.setText')' in this line: 'self.enemyCounter.setText(self.enemies.length.toString());' Line Number: 312
User prompt
Fix Bug: 'Timeout.tick error: undefined is not an object (evaluating 'self.enemyCounter.setText')' in this line: 'self.enemyCounter.setText(self.enemies.length.toString());' Line Number: 310
User prompt
Fix Bug: 'Timeout.tick error: undefined is not an object (evaluating 'self.enemyCounter.setText')' in this line: 'self.enemyCounter.setText(self.enemies.length.toString());' Line Number: 308
===================================================================
--- original.js
+++ change.js
@@ -189,8 +189,10 @@
var pickup = bombPickups[i];
if (hero.intersects(pickup)) {
while (self.enemies.length > 0) {
var enemy = self.enemies.pop();
+ self.score += 10;
+ scoreDisplay.setText(self.score.toString());
enemy.destroy();
}
self.bombCountdown.timeRemaining = 30;
self.bombCountdown.update(0);
@@ -277,10 +279,19 @@
self.stars.push(star);
self.addChild(star);
}
var hero = self.addChild(new Hero());
+ var scoreDisplay = new Text2('0', {
+ size: 100,
+ fill: '#ffffff'
+ });
+ scoreDisplay.anchor.set(0.5, 0);
+ scoreDisplay.x = 2048 - scoreDisplay.width / 2;
+ scoreDisplay.y = 50;
+ LK.gui.topRight.addChild(scoreDisplay);
hero.healthBar = self.addChild(new HealthBar(hero.health, hero.health));
self.enemies = [];
+ self.score = 0;
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