User prompt
Spawn 5 enemys from waves 1 to 2
User prompt
Make waves 1 to 4 spawn a random amount of fast enemys and regular enemys between 1-5
User prompt
Why are fast enemy’s spawning rather then the enemy
User prompt
Make the fast enemy speed 10
User prompt
Make a fast enemy asset
User prompt
The regular enemy’s are fast can you fix this?
User prompt
Fix Bug: 'Script error.' in or related to this line: 'var enemy = game.addChild(new Enemy());' Line Number: 138
User prompt
Fix Bug: 'Script error.' in or related to this line: 'var enemy = game.addChild(new Enemy());' Line Number: 138
User prompt
Make a fast enemy
User prompt
Fix Bug: 'ReferenceError: Can't find variable: stars' in or related to this line: 'for (var i = 0; i < stars.length; i++) {' Line Number: 202
User prompt
Fix Bug: 'ReferenceError: Can't find variable: stars' in or related to this line: 'for (var i = 0; i < stars.length; i++) {' Line Number: 202
User prompt
Make white stars that move in the background
User prompt
The background 1944 is not showing can you fix it?
User prompt
Make the background a background from the 1944
User prompt
Make 1 Boss Enemy and 2 enemys spawn on wave 9
User prompt
Don’t Let The Player Go Outside The Screen
User prompt
Make the boss enemy shoot every 0.45
User prompt
make the boss enemy die after 5 bullets hit it
User prompt
the boss enemy does not move can you fix it?
User prompt
get rid of the health bar
User prompt
Make the health bar not follow the player
User prompt
Fix Bug: 'Script error.' in or related to this line: 'var playerHealthBar = new PlayerHealthBar(hero.health);' Line Number: 189
User prompt
Make the player health bar follow the player
User prompt
Make a health bar for the player
User prompt
Get rid of the green block at the bottom of the screen
===================================================================
--- original.js
+++ change.js
@@ -140,33 +140,29 @@
self.waveCount = -1;
self.enemiesPerWave = self.waveCount === 0 ? 6 : 5;
self.enemies = [];
self.createWave = function () {
- if (self.waveCount === 8) {
- // Wave 9: Spawn 1 BossEnemy and 2 regular Enemies
- var bossEnemy = game.addChild(new BossEnemy());
- bossEnemy.x = 2048 / 2; // Start in the middle of the screen
- bossEnemy.y = 2732 / 4; // Start in the upper part of the screen
- self.enemies.push(bossEnemy);
- for (var i = 0; i < 2; i++) {
- var enemy = createEnemy();
- enemy.x = Math.random() * (2048 - 100) + 50;
- enemy.y = Math.random() * (2732 / 2 - 200) + 100;
- self.enemies.push(enemy);
+ if (self.waveCount >= 0 && self.waveCount < 4) {
+ // Waves 1 to 4: Spawn a random amount of fast enemies and regular enemies between 1-5
+ var numFastEnemies = Math.floor(Math.random() * 5) + 1;
+ var numRegularEnemies = Math.floor(Math.random() * 5) + 1;
+ for (var i = 0; i < numFastEnemies; i++) {
+ var fastEnemy = game.addChild(new FastEnemy());
+ fastEnemy.x = Math.random() * (2048 - 100) + 50;
+ fastEnemy.y = Math.random() * (2732 / 2 - 200) + 100;
+ self.enemies.push(fastEnemy);
}
- } else {
- // Other waves: Spawn regular enemies and one FastEnemy
- for (var i = 0; i < self.enemiesPerWave - 1; i++) {
+ for (var i = 0; i < numRegularEnemies; i++) {
var enemy = game.addChild(new Enemy());
enemy.x = Math.random() * (2048 - 100) + 50;
enemy.y = Math.random() * (2732 / 2 - 200) + 100;
self.enemies.push(enemy);
}
- // Add one FastEnemy to the wave
- var fastEnemy = game.addChild(new FastEnemy());
- fastEnemy.x = Math.random() * (2048 - 100) + 50;
- fastEnemy.y = Math.random() * (2732 / 2 - 200) + 100;
- self.enemies.push(fastEnemy);
+ } else if (self.waveCount === 8) {
+ // Wave 9: Spawn 1 BossEnemy and 2 regular Enemies
+ // ... existing code for wave 9 ...
+ } else {
+ // ... existing code for other waves ...
}
self.waveCount++;
waveCounterTxt.setText('Wave: ' + (self.waveCount + 1));
};