User prompt
Fix Bug: 'ReferenceError: heroGraphics is not defined' in this line: 'bullet.y = hero.y - heroGraphics.height / 2;' Line Number: 91
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'addEventListener')' in this line: 'document.addEventListener('keydown', function (event) {' Line Number: 80
User prompt
define movement controls for player: spacebar to shoot bullets, WASD keys to move
User prompt
reverse direction of enemy bullets
User prompt
update enemy bullet spawn to match enemy spawn
User prompt
reverse direction of movement so that enemies start at the top of the screen and move down
User prompt
change the scroll direction to vertical
Initial prompt
Side Scroller Endless Runner
===================================================================
--- original.js
+++ change.js
@@ -10,9 +10,9 @@
var self = Container.call(this);
var enemyGraphics = self.createAsset('enemy', 'Enemy character', .5, .5);
self.speed = -3;
self.move = function () {
- self.y += self.speed;
+ self.y -= self.speed;
};
});
var HeroBullet = Container.expand(function () {
var self = Container.call(this);
@@ -78,10 +78,10 @@
self.addChild(bullet);
});
LK.setInterval(function () {
var enemy = new Enemy();
+ enemy.x = Math.random() * 2048;
enemy.y = -50;
- enemy.y = Math.random() * 2732;
enemies.push(enemy);
self.addChild(enemy);
}, 2000);
LK.setInterval(function () {
Create a plain red health bar Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Create a plain empty health bar Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Create a top down view of a single Earth-like planet Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A background image of some stars in space Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A background image of asteroids in space Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A realistic looking explosion, viewed from above. Bright coloured fire Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a double missile pointing vertically, with fire coming out of the rear Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A health pickup icon Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A cool looking spaceship viewed from above Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A round energy based projectile. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.