User prompt
Fix Bug: 'TypeError: undefined is not an object (evaluating 'self.parent.hero.x')' in this line: 'if (self.parent.hero.x === self.parent.hero.lastX && self.parent.hero.y === self.parent.hero.lastY) {' Line Number: 97
User prompt
Make the change 1 above - enemy behaviour
User prompt
the still text is not updating if the player is moving or still
User prompt
the still text is not visisble
User prompt
new UI element - write 'still' top left of the screen if the game logic considered the player still
User prompt
consider the player 'still' if they have not moved in 2000ms
User prompt
add a red asset to portray the red enemy
User prompt
redenemy should be red
User prompt
create a new enemy type redenemy that spawns if the player has been still for more than 2 seconds
User prompt
track if the player has stayed still
User prompt
Fix Bug: 'TypeError: undefined is not an object (evaluating 'self.parent.hero.lastMovedTime')' in this line: 'if (LK.ticks - self.parent.hero.lastMovedTime > 120) {' Line Number: 99
User prompt
If the player stays still for longer than 2 seconds, all enemies should converge on the player
User prompt
set maximum fire rate to 200ms
User prompt
Fix Bug: 'TypeError: undefined is not an object (evaluating 'self.parent.hero.getPosition')' in this line: 'var playerPos = self.parent.hero.getPosition();' Line Number: 97
User prompt
Fix Bug: 'Timeout.tick error: null is not an object (evaluating 'self.parent.on')' in this line: 'self.parent.on('tick', self.setDirectionAndSpeed);' Line Number: 104
User prompt
Fix Bug: 'Timeout.tick error: null is not an object (evaluating 'this.parent.hero')' in this line: 'var playerPos = this.parent.hero.getPosition();' Line Number: 94
User prompt
Add a modifier to the move function of the yellowenemy class that biases it to moving in a random direction within 20 degrees of the player craters position
User prompt
create a maximum fire rate for the player gun, start with it set to 100ms
User prompt
reduce the maximum number of active bullets allowed to 2
User prompt
add a counter to the top left of the screen for how many player bullets are active
User prompt
reduce enemy spawn interval from 350 to 325 ms
User prompt
increase enemy spawn interval from 300 to 350 ms
User prompt
reduce enemy spawn interval from 400 to 300 ms
User prompt
reduce enemy spawn interval from 500 to 400 ms
User prompt
increase enemy spawn interval from 250 to 500ms
===================================================================
--- original.js
+++ change.js
@@ -93,9 +93,9 @@
self.enemyGraphics = self.createAsset('yellowEnemy', 'Yellow Enemy character', .5, .5);
var direction = Math.random() * Math.PI * 2;
var speed = 2 * (0.8 + Math.random() * 1);
self.move = function () {
- if (self.parent.hero.x === self.parent.hero.lastX && self.parent.hero.y === self.parent.hero.lastY) {
+ if (self.parent && self.parent.hero && self.parent.hero.x === self.parent.hero.lastX && self.parent.hero.y === self.parent.hero.lastY) {
direction = Math.atan2(self.parent.hero.y - self.y, self.parent.hero.x - self.x);
}
if (direction < 0) direction += 2 * Math.PI;
if (direction > 2 * Math.PI) direction -= 2 * Math.PI;
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