User prompt
make a space shooter ninja game including a boss asset
User prompt
write everthying from scratch for a ninja shooter game.
User prompt
Fix Bug: 'Uncaught ReferenceError: cityBackground is not defined' in this line: 'self.addChildAt(cityBackground, 0);' Line Number: 84
User prompt
make the player move using touch controls instead of onscreen buttons and fix all errors of the game and make it a space shooter game
User prompt
make the hero move using onscreen button mapping
User prompt
the boss shoots ninja bullets to the hero
User prompt
when the bossbullet is shot he dies
User prompt
expand the cityscreen to fill the whol screen.make the hero fight the boss and fix all errors
User prompt
let the hero move in all directions and fix all the errors including the resolution in the game.
User prompt
i want the hero to fight the boss back but it's not too easy to win
User prompt
Fix Bug: 'ReferenceError: heroBullets is not defined' in this line: 'if (heroBullets[i].intersects(boss)) {}' Line Number: 80
User prompt
Fix Bug: 'ReferenceError: heroBullets is not defined' in this line: 'heroBullets[i].move();' Line Number: 72
User prompt
Fix Bug: 'ReferenceError: bossBullets is not defined' in this line: 'for (var i = 0; i < bossBullets.length; i++) {' Line Number: 82
User prompt
Fix Bug: 'ReferenceError: bossBullets is not defined' in this line: 'bossBullets[i].move();' Line Number: 75
User prompt
Fix Bug: 'ReferenceError: bossBullets is not defined' in this line: 'for (var i = 0; i < bossBullets.length; i++) {' Line Number: 82
User prompt
Fix Bug: 'ReferenceError: heroBullets is not defined' in this line: 'for (var i = 0; i < heroBullets.length; i++) {' Line Number: 79
User prompt
Fix Bug: 'ReferenceError: heroBullets is not defined' in this line: 'for (var i = 0; i < heroBullets.length; i++) {' Line Number: 80
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'push')' in this line: 'self.parent.bossBullets.push(bullet);' Line Number: 36
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'push')' in this line: 'self.parent.bossBullets.push(bullet);' Line Number: 35
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'push')' in this line: 'self.parent.bossBullets.push(bullet);' Line Number: 35
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'push')' in this line: 'self.parent.bossBullets.push(bullet);' Line Number: 34
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'push')' in this line: 'self.parent.bossBullets.push(bullet);' Line Number: 34
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'push')' in this line: 'self.parent.bossBullets.push(bullet);' Line Number: 34
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'push')' in this line: 'self.parent.bossBullets.push(bullet);' Line Number: 34
User prompt
i want to create a futuristic fighting game 20 years ahead of now in japan
var NinjaShuriken = Container.expand(function () { var self = Container.call(this); var shurikenGraphics = self.createAsset('ninjaShuriken', 'Ninja Shuriken', .5, .5); self.speed = 10; self.move = function () { self.y -= self.speed; }; }); var NinjaHero = Container.expand(function () { var self = Container.call(this); var ninjaGraphics = self.createAsset('ninjaHero', 'Ninja Hero', .5, .5); self.speed = 5; self.move = function (direction) { if (direction === 'left' && self.x > 0) self.x -= self.speed; else if (direction === 'right' && self.x < 2048 - self.width) self.x += self.speed; else if (direction === 'up' && self.y > 0) self.y -= self.speed; else if (direction === 'down' && self.y < 2732 - self.height) self.y += self.speed; }; self.throwShuriken = function () { var shuriken = new NinjaShuriken(); shuriken.x = self.x; shuriken.y = self.y - self.height / 2; self.parent.ninjaShurikens.push(shuriken); self.parent.addChild(shuriken); }; }); var NinjaStar = Container.expand(function () { var self = Container.call(this); var starGraphics = self.createAsset('ninjaStar', 'Ninja Star', .5, .5); self.speed = 15; self.move = function () { self.y -= self.speed; }; }); var Game = Container.expand(function () { var self = Container.call(this); var ninjaHero = self.addChild(new NinjaHero()); ninjaHero.x = 2048 / 2; ninjaHero.y = 2732 - ninjaHero.height; this.ninjaShurikens = []; this.ninjaStars = []; self.on('down', function (obj) { var event = obj.event; var pos = event.getLocalPosition(self); ninjaHero.x = pos.x; ninjaHero.y = pos.y; }); LK.on('tick', function () { for (var i = self.ninjaShurikens.length - 1; i >= 0; i--) { self.ninjaShurikens[i].move(); if (self.ninjaShurikens[i].y < -50) { self.ninjaShurikens[i].destroy(); self.ninjaShurikens.splice(i, 1); } } for (var i = self.ninjaStars.length - 1; i >= 0; i--) { self.ninjaStars[i].move(); if (self.ninjaStars[i].y < -50) { self.ninjaStars[i].destroy(); self.ninjaStars.splice(i, 1); } } }); });
===================================================================
--- original.js
+++ change.js
@@ -1,137 +1,61 @@
-var ControlButton = Container.expand(function (label, action) {
+var NinjaShuriken = Container.expand(function () {
var self = Container.call(this);
- var buttonGraphics = self.createAsset('button', label, 0.5, 0.5);
- buttonGraphics.interactive = true;
- buttonGraphics.buttonMode = true;
- self.action = action;
- buttonGraphics.on('down', function () {
- self.action();
- });
-});
-var BossNinjaBullet = Container.expand(function () {
- var self = Container.call(this);
- var bulletGraphics = self.createAsset('bossNinjaBullet', 'Boss Ninja Bullet', .5, .5);
+ var shurikenGraphics = self.createAsset('ninjaShuriken', 'Ninja Shuriken', .5, .5);
+ self.speed = 10;
self.move = function () {
- self.y += 7;
+ self.y -= self.speed;
};
});
-var Hero = Container.expand(function () {
+var NinjaHero = Container.expand(function () {
var self = Container.call(this);
- var heroGraphics = self.createAsset('spaceship', 'Hero spaceship', .5, .5);
+ var ninjaGraphics = self.createAsset('ninjaHero', 'Ninja Hero', .5, .5);
+ self.speed = 5;
self.move = function (direction) {
- var speed = 5;
- switch (direction) {
- case 'left':
- if (self.x > 0) self.x -= speed;
- break;
- case 'right':
- if (self.x < 2048 - self.width) self.x += speed;
- break;
- case 'up':
- if (self.y > 0) self.y -= speed;
- break;
- case 'down':
- if (self.y < 2732 - self.height) self.y += speed;
- break;
- }
+ if (direction === 'left' && self.x > 0) self.x -= self.speed; else if (direction === 'right' && self.x < 2048 - self.width) self.x += self.speed; else if (direction === 'up' && self.y > 0) self.y -= self.speed; else if (direction === 'down' && self.y < 2732 - self.height) self.y += self.speed;
};
- self.attack = function () {
- var bullet = new HeroBullet();
- bullet.x = self.x;
- bullet.y = self.y - self.height / 2;
- self.parent.heroBullets.push(bullet);
- self.parent.addChild(bullet);
+ self.throwShuriken = function () {
+ var shuriken = new NinjaShuriken();
+ shuriken.x = self.x;
+ shuriken.y = self.y - self.height / 2;
+ self.parent.ninjaShurikens.push(shuriken);
+ self.parent.addChild(shuriken);
};
});
-var Boss = Container.expand(function () {
+var NinjaStar = Container.expand(function () {
var self = Container.call(this);
- var bossGraphics = self.createAsset('boss', 'Boss character', .5, .5);
- self.health = 100;
+ var starGraphics = self.createAsset('ninjaStar', 'Ninja Star', .5, .5);
+ self.speed = 15;
self.move = function () {
- var speed = 3;
- self.x += speed * (self.x < 1024 ? 1 : -1);
- self.y += speed * (self.y < 1366 ? 1 : -1);
- self.x = Math.max(self.width / 2, Math.min(self.x, 2048 - self.width / 2));
- self.y = Math.max(self.height / 2, Math.min(self.y, 2732 - self.height / 2));
+ self.y -= self.speed;
};
- self.attack = function () {
- var ninjaBullet = new BossNinjaBullet();
- ninjaBullet.x = self.x;
- ninjaBullet.y = self.y + self.height / 2;
- self.parent.bossBullets.push(ninjaBullet);
- self.parent.addChild(ninjaBullet);
- };
});
-var HeroBullet = Container.expand(function () {
- var self = Container.call(this);
- var bulletGraphics = self.createAsset('heroBullet', 'Hero Bullet', .5, .5);
- self.move = function () {
- self.y -= 10;
- };
-});
-var BossBullet = Container.expand(function () {
- var self = Container.call(this);
- var bulletGraphics = self.createAsset('bossBullet', 'Boss Bullet', .5, .5);
- self.move = function () {
- self.y += 7;
- };
-});
var Game = Container.expand(function () {
var self = Container.call(this);
- var spaceBackground = self.createAsset('space', 'Space background', 0, 0);
- spaceBackground.width = 2048;
- spaceBackground.height = 2732;
- self.addChildAt(spaceBackground, 0);
- var hero = self.addChild(new Hero());
- var boss = self.addChild(new Boss());
- hero.x = 2048 / 2;
- hero.y = 2732 - hero.height;
- boss.x = 2048 / 2;
- boss.y = boss.height;
- this.heroBullets = [];
- this.bossBullets = [];
+ var ninjaHero = self.addChild(new NinjaHero());
+ ninjaHero.x = 2048 / 2;
+ ninjaHero.y = 2732 - ninjaHero.height;
+ this.ninjaShurikens = [];
+ this.ninjaStars = [];
self.on('down', function (obj) {
var event = obj.event;
var pos = event.getLocalPosition(self);
- hero.x = pos.x;
- hero.y = pos.y;
+ ninjaHero.x = pos.x;
+ ninjaHero.y = pos.y;
});
LK.on('tick', function () {
- if (LK.ticks % 120 == 0) {
- boss.attack();
- }
- });
- LK.on('tick', function () {
- for (var i = self.heroBullets.length - 1; i >= 0; i--) {
- self.heroBullets[i].move();
- if (self.heroBullets[i].y < -50) {
- self.heroBullets[i].destroy();
- self.heroBullets.splice(i, 1);
+ for (var i = self.ninjaShurikens.length - 1; i >= 0; i--) {
+ self.ninjaShurikens[i].move();
+ if (self.ninjaShurikens[i].y < -50) {
+ self.ninjaShurikens[i].destroy();
+ self.ninjaShurikens.splice(i, 1);
}
}
- for (var i = self.bossBullets.length - 1; i >= 0; i--) {
- self.bossBullets[i].move();
- if (self.bossBullets[i].y > 2732 + 50) {
- self.bossBullets[i].destroy();
- self.bossBullets.splice(i, 1);
+ for (var i = self.ninjaStars.length - 1; i >= 0; i--) {
+ self.ninjaStars[i].move();
+ if (self.ninjaStars[i].y < -50) {
+ self.ninjaStars[i].destroy();
+ self.ninjaStars.splice(i, 1);
}
}
});
- LK.on('tick', function () {
- for (var i = self.heroBullets.length - 1; i >= 0; i--) {
- if (self.heroBullets[i].intersects(boss)) {
- boss.health -= 10;
- self.heroBullets[i].destroy();
- self.heroBullets.splice(i, 1);
- if (boss.health <= 0) {
- LK.showGameOver();
- }
- }
- }
- for (var i = self.bossBullets.length - 1; i >= 0; i--) {
- if (self.bossBullets[i].intersects(hero)) {
- LK.showGameOver();
- }
- }
- });
});
HERO IS A MASTER SAMURAI WARRIOR Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.RTX ON.INRECEDIBLE DETAIL.ULTRA HD .
future japan high graphics photo
a samurai sumo big in size. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a samurai sumo big in size. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.