User prompt
When level is restarted, destroy levelCompleteText and the nexLevelButton
User prompt
When self.resetLevel method is called, increase number of levels by 1, restart the level.
User prompt
Fix Bug: 'TypeError: self.resetLevel is not a function' in this line: 'self.resetLevel();' Line Number: 135
User prompt
When the text "Level complete" shows up, I want a BIG button with label "Next level >" below it.
User prompt
When self.touchesLeft = 0, the game should be over.
User prompt
Each time the target gets destroyed, check the number of targets left. When targets left becomes zero, show the text (central info text) in the center: "Level completed"
User prompt
When player touches the Next level Button, restart the level but with 3 targets more than in the previous level
User prompt
Each time the target gets destroyed, check the number of targets left. When targets left becomes zero, show the text (central info text) in the center: "Level completed" and show one button below it, with label: Next level
User prompt
When touches left becomes zero, show the text in the center: "Game Over"
User prompt
Each time the target gets destroyed, check the number of targets left. When targets left becomes zero, show the text in the center: "Level completed"
User prompt
Make a text field in the center. Once, when targets left = 0, white text should say "Level Complete!"
User prompt
Make a text field in the center. When targets left = 0, text should say "Level Complete!"
User prompt
Fix Bug: 'ReferenceError: touchesLeftText is not defined' in this line: 'touchesLeftText.setText('Touches Left: ' + self.touchesLeft);' Line Number: 141
User prompt
Make a 2 text fields in the center, one above another. When targets left = 0, the upper text should say "Level Complete!" The bottom text, with smaller font, should say "Tap anywhere for the next level"
User prompt
Make a text field in the center. When targets left = 0, text should say "Level Complete!"
User prompt
Create star field, behind everything. Stars start from the center of the screen and go in random directions. When a star reaches the border of the scene, it gets back to its starting position.
User prompt
When number of targets is 0, show the level complete message in the center of the scene
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'intersects')' in this line: 'if (self.children[i].intersects(targets[j])) {' Line Number: 101
User prompt
Make particle explosion effect when target gets destroyed. Generate 30 small particles that go in random directions from the target center and fade out after 1 second.
User prompt
Make explosion effect when target gets destroyed
User prompt
Increase level number by 1 and display it when the last target gets destroyed
User prompt
When the last target gets destroyed, increase level number by 1 and display it
User prompt
If targets left = 0, increase level number
User prompt
If there are no touches left AND all existing player's projectiles are destroyed, game over
User prompt
If there are no touches left, game over
var Particle = Container.expand(function () { var self = Container.call(this); var particleGraphics = self.createAsset('particle', 'Particle Graphics', .5, .5); self.speed = Math.random() * 5 + 2; self.direction = Math.random() * Math.PI * 2; self.alpha = 1; self.move = function () { self.x += Math.cos(self.direction) * self.speed; self.y += Math.sin(self.direction) * self.speed; self.alpha -= 0.02; if (self.alpha <= 0) self.destroy(); }; }); var Projectile = Container.expand(function () { var self = Container.call(this); var projectileGraphics = self.createAsset('projectile', 'Projectile Graphics', .5, .5); self.speed = 14; self.direction = ''; self.move = function () { if (self.direction === 'up') self.y -= self.speed; if (self.direction === 'down') self.y += self.speed; if (self.direction === 'left') self.x -= self.speed; if (self.direction === 'right') self.x += self.speed; }; }); var Target = Container.expand(function () { var self = Container.call(this); var targetGraphics = self.createAsset('target', 'Target Graphics', .5, .5); self.speed = 7; 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); self.level = 1; self.touchesLeft = 5; self.targetsLeft = 5; var levelCompleteText = new Text2('', { size: 70, fill: '#ffffff' }); levelCompleteText.anchor.set(0.5, 0.5); levelCompleteText.x = 2048 / 2; levelCompleteText.y = 2732 / 2; LK.gui.center.addChild(levelCompleteText); var levelText = new Text2('Level: ' + self.level, { size: 70, fill: "#ffffff" }); levelText.anchor.set(0, 0); LK.gui.topLeft.addChild(levelText); var touchesLeftText = new Text2('Touches Left: ' + self.touchesLeft, { size: 70, fill: "#ffffff" }); touchesLeftText.anchor.set(0, 0); touchesLeftText.y = 120; LK.gui.topLeft.addChild(touchesLeftText); var targetsLeftText = new Text2('Targets Left: ' + self.targetsLeft, { size: 70, fill: "#ffffff" }); targetsLeftText.anchor.set(0, 0); targetsLeftText.y = 240; LK.gui.topLeft.addChild(targetsLeftText); var enemyBullets = []; var enemies = []; var targets = []; var touchesLeft = 5; 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(); } for (var i = 0; i < self.children.length; i++) { if (self.children[i] instanceof Projectile || self.children[i] instanceof Particle) { self.children[i].move(); for (var j = 0; j < targets.length; j++) { if (self.children[i] && targets[j] && self.children[i].intersects(targets[j])) { var directions = ['up', 'down', 'left', 'right']; for (var k = 0; k < 4; k++) { var newProjectile = new Projectile(); newProjectile.x = targets[j].x; newProjectile.y = targets[j].y; newProjectile.direction = directions[k]; self.addChild(newProjectile); } self.children[i].destroy(); for (var k = 0; k < 30; k++) { var particle = new Particle(); particle.x = targets[j].x; particle.y = targets[j].y; self.addChild(particle); } targets[j].destroy(); self.targetsLeft--; targets.splice(j, 1); targetsLeftText.setText('Targets Left: ' + self.targetsLeft); if (self.targetsLeft === 0) { levelCompleteText.setText('Level Complete!'); } } } } } }); stage.on('down', function (obj) { if (touchesLeft > 0) { var pos = obj.event.getLocalPosition(self); var directions = ['up', 'down', 'left', 'right']; for (var i = 0; i < 4; i++) { var projectile = new Projectile(); projectile.x = pos.x; projectile.y = pos.y; projectile.direction = directions[i]; self.addChild(projectile); } if (self.touchesLeft > 0) { self.touchesLeft--; touchesLeftText.setText('Touches Left: ' + self.touchesLeft); } } }); });
===================================================================
--- original.js
+++ change.js
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.