User prompt
Double the speed of targets, let targets have the same speed.
User prompt
Remove hero, we dont need it
User prompt
Fix Bug: 'ReferenceError: hero is not defined' in this line: 'hero.x = pos.x;' Line Number: 55
User prompt
Remove all existing objects. Make 5 dots on random positions (call them 'Targets') Let dots go in random directions, but only vertically or horizontally When Target leaves the scene, make it appear on the opposite side of the scene.
User prompt
make 5 dots on random positions
User prompt
Remove all
User prompt
When touches left =0, and still there's at least one target on the screen, the game is over.
User prompt
When number of touches = 0, if not all targets are destroyed, the game is over
User prompt
When the player touches 'Next' button, just increase the level number, reset the number of touches to 5 and create new targets on the screen. Make this numberr or targets: level number * 5
User prompt
Fix Bug: 'ReferenceError: touchesLeftText is not defined' in this line: 'if (touchesLeftText) touchesLeftText.destroy();' Line Number: 63
User prompt
Fix Bug: 'ReferenceError: levelText is not defined' in this line: 'if (levelText) levelText.destroy();' Line Number: 55
User prompt
When the level is over, and the user clicks the 'Next' button, destroy all text fields and re-create them.
User prompt
Fix Bug: 'ReferenceError: touchesLeftText is not defined' in this line: 'touchesLeftText.setText('Touches left: ' + ammunition);' Line Number: 62
User prompt
Fix Bug: 'ReferenceError: touchesLeftText is not defined' in this line: 'touchesLeftText.setText('Touches left: ' + ammunition);' Line Number: 62
User prompt
There's a duplicate of text field 'Touches left'. Fix it.
User prompt
Fix Bug: 'ReferenceError: touchesLeftText is not defined' in this line: 'touchesLeftText.setText('Touches left: ' + ammunition);' Line Number: 62
User prompt
Fix Bug: 'ReferenceError: touchesLeftText is not defined' in this line: 'touchesLeftText.setText('Touches left: ' + ammunition);' Line Number: 62
User prompt
Fix Bug: 'ReferenceError: touchesLeftText is not defined' in this line: 'touchesLeftText.setText('Touches left: ' + ammunition);' Line Number: 62
User prompt
Fix Bug: 'ReferenceError: levelText is not defined' in this line: 'levelText.setText('Lvl: ' + self.level);' Line Number: 55
User prompt
Fix Bug: 'ReferenceError: levelText is not defined' in this line: 'levelText.setText('Lvl: ' + self.level);' Line Number: 55
User prompt
When user taps the 'Next level' button, start the next level. Create more targets (number of targets should be = level * 5. Reset number or allowed touches to 5.
User prompt
Fix Bug: 'ReferenceError: levelText is not defined' in this line: 'levelText.setText('Lvl: ' + self.level);' Line Number: 55
User prompt
Make the 'Next' level buton 3 times wider. Place a label on it: "Next"
User prompt
Center the instruction text horizontally.
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'setText')' in this line: 'self.levelText.setText('Lvl: ' + self.level);' Line Number: 48
var Target = Container.expand(function () { var self = Container.call(this); var targetGraphics = self.createAsset('target', 'Target Graphics', .5, .5); self.speed = Math.random() * 5; self.direction = Math.random() < 0.5 ? 'horizontal' : 'vertical'; self.move = function () { if (self.direction === 'horizontal') { self.x += self.speed; if (self.x > 2048) self.x = 0; if (self.x < 0) self.x = 2048; } else { self.y += self.speed; if (self.y > 2732) self.y = 0; if (self.y < 0) self.y = 2732; } }; }); var Game = Container.expand(function () { var self = Container.call(this); var enemyBullets = []; var enemies = []; var targets = []; for (var i = 0; i < 5; i++) { var target = new Target(); target.x = Math.random() * 2048; target.y = Math.random() * 2732; targets.push(target); self.addChild(target); } var spawnEnemy = function () { var enemy = new Enemy(); enemy.x = Math.random() * 2048; enemy.y = 0; enemies.push(enemy); self.addChild(enemy); }; var fireEnemyBullet = function (enemy) { var bullet = new EnemyBullet(); bullet.x = enemy.x; bullet.y = enemy.y; enemyBullets.push(bullet); self.addChild(bullet); }; LK.on('tick', function () { for (var i = 0; i < targets.length; i++) { targets[i].move(); } }); });
===================================================================
--- original.js
+++ change.js
@@ -16,10 +16,8 @@
};
});
var Game = Container.expand(function () {
var self = Container.call(this);
- var hero = self.createAsset('hero', 'Hero character', .5, .5);
- var heroBullets = [];
var enemyBullets = [];
var enemies = [];
var targets = [];
for (var i = 0; i < 5; i++) {
@@ -35,28 +33,15 @@
enemy.y = 0;
enemies.push(enemy);
self.addChild(enemy);
};
- var fireHeroBullet = function () {
- var bullet = new HeroBullet();
- bullet.x = hero.x;
- bullet.y = hero.y;
- heroBullets.push(bullet);
- self.addChild(bullet);
- };
var fireEnemyBullet = function (enemy) {
var bullet = new EnemyBullet();
bullet.x = enemy.x;
bullet.y = enemy.y;
enemyBullets.push(bullet);
self.addChild(bullet);
};
- var handleMove = function (obj) {
- var event = obj.event;
- var pos = event.getLocalPosition(self);
- hero.x = pos.x;
- };
- stage.on('move', handleMove);
LK.on('tick', function () {
for (var i = 0; i < targets.length; i++) {
targets[i].move();
}
Simple flat icon, 200x200pixels, one bright color square with border. No shadows, top down view, transparent background. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Simple flat icon, 200x200pixels, one bright color circle with border. No shadows, top down view, transparent background. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Simple flat icon, 200x200pixels, one bright color diamond with border. No shadows, top down view, transparent background. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Simple flat icon, 200x200pixels, one bright color romb with border. No shadows, top down view, transparent background. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Simple flat icon, 200x200pixels, one bright color smiley with border. No shadows, top down view, transparent background. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
1024x1366 pixels, totally black no more than 20 very small, barely visible, stars here and there. Simple Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Single Game Texture, 50x50pix. In-Game asset. 2d. Blank background. High contrast. No shadows. Light green circle with border. Simple. No other objects. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.