User prompt
remove enemies
User prompt
Make the enemies spawn from the top, left, bottom and right side of the screens
User prompt
fix it
User prompt
make them appear from random positions from all directions
User prompt
create enemies that spawn from outside the screen and go towards the hero
User prompt
make the background grass green
Initial prompt
not vampire survivors
===================================================================
--- original.js
+++ change.js
@@ -3,20 +3,8 @@
var heroGraphics = self.createAsset('hero', 'Hero character', .5, .5);
self.move = function () {};
self.shoot = function () {};
});
-var Enemy = Container.expand(function () {
- var self = Container.call(this);
- var enemyGraphics = self.createAsset('enemy', 'Enemy character', .5, .5);
- self.move = function () {
- self.x -= 5;
- if (self.x < 0) {
- self.x = 2048;
- self.y = Math.random() * 2732;
- }
- };
- self.attack = function () {};
-});
var HeroBullet = Container.expand(function () {
var self = Container.call(this);
var bulletGraphics = self.createAsset('heroBullet', 'Hero Bullet', .5, .5);
self.move = function () {};
@@ -30,43 +18,15 @@
var self = Container.call(this);
LK.stageContainer.setBackgroundColor(0x008000);
var hero = self.addChild(new Hero());
var enemies = [];
- for (var i = 0; i < 10; i++) {
- var enemy = new Enemy();
- var spawnSide = Math.floor(Math.random() * 4);
- switch (spawnSide) {
- case 0:
- enemy.x = Math.random() * 2048;
- enemy.y = 0;
- break;
- case 1:
- enemy.x = Math.random() * 2048;
- enemy.y = 2732;
- break;
- case 2:
- enemy.x = 2048;
- enemy.y = Math.random() * 2732;
- break;
- case 3:
- enemy.x = 0;
- enemy.y = Math.random() * 2732;
- break;
- }
- enemies.push(enemy);
- self.addChild(enemy);
- }
var heroBullets = [];
var enemyBullets = [];
hero.x = 2048 / 2;
hero.y = 2732 / 2;
LK.on('tick', function () {
hero.move();
hero.shoot();
- for (var i = 0; i < enemies.length; i++) {
- enemies[i].move();
- enemies[i].attack();
- }
for (var i = 0; i < heroBullets.length; i++) {
heroBullets[i].move();
}
for (var i = 0; i < enemyBullets.length; i++) {
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.