User prompt
remove shooting
User prompt
make the hero shoot the nearest enemy every half a second
User prompt
remove shooting
User prompt
bullets that the hero shoot must spawn from the heros position
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'indexOf')' in this line: 'var index = self.target.heroBullets.indexOf(self);' Line Number: 64
User prompt
Fix Bug: 'ReferenceError: hero is not defined' in this line: 'var index = hero.heroBullets.indexOf(self);' Line Number: 64
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'heroBullets')' in this line: 'var index = self.parent.heroBullets.indexOf(self);' Line Number: 64
User prompt
Fix Bug: 'ReferenceError: hero is not defined' in this line: 'var index = hero.heroBullets.indexOf(self);' Line Number: 64
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'hero')' in this line: 'var index = self.parent.hero.heroBullets.indexOf(self);' Line Number: 64
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'heroBullets')' in this line: 'var index = self.parent.heroBullets.indexOf(self);' Line Number: 64
User prompt
Fix Bug: 'ReferenceError: heroBullets is not defined' in this line: 'var index = heroBullets.indexOf(self);' Line Number: 64
User prompt
Fix Bug: 'ReferenceError: heroBullets is not defined' in this line: 'heroBullets.push(bullet);' Line Number: 30
User prompt
Fix Bug: 'ReferenceError: enemies is not defined' in this line: 'enemies.push(enemy);' Line Number: 110
User prompt
Fix Bug: 'ReferenceError: enemies is not defined' in this line: 'for (var i = 0; i < enemies.length; i++) {' Line Number: 124
User prompt
Fix Bug: 'ReferenceError: enemies is not defined' in this line: 'if (enemies.length > 0) {' Line Number: 16
User prompt
make the hero shoot shoot towards the nearest enemy. the hero should shoot at a fixed rate of once every 500ms
User prompt
Fix Bug: 'TypeError: hero.move is not a function' in this line: 'hero.move();' Line Number: 80
User prompt
remove the hero move logic
User prompt
when the hero moves, instead of teleporting, make it move / run to the position at a fixed move speed
User prompt
when clicking on the screen, move the character to the position
User prompt
when an enemy touches the hero, the enemy should die and delete
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'addEventListener')' in this line: 'document.addEventListener('keydown', function (event) {' Line Number: 92
User prompt
Use keyboard input to move the character. WASD to go up, left, down and right
User prompt
Fix Bug: 'ReferenceError: hero is not defined' in this line: 'var dx = hero.x - self.x;' Line Number: 5
User prompt
create a new entity called enemy. Enemies should spawn from the top, bottom, left and right side of the screens and move towards the character, following the hero til they touch it
===================================================================
--- original.js
+++ change.js
@@ -60,9 +60,9 @@
self.x += dx / distance * 5;
self.y += dy / distance * 5;
} else {
self.destroy();
- var index = hero.heroBullets.indexOf(self);
+ var index = self.target.heroBullets.indexOf(self);
if (index > -1) {
hero.heroBullets.splice(index, 1);
}
}
vampire hunter pixel art Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art vampire, single sprite Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art boomerang Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.