User prompt
Fix Bug: 'ReferenceError: Can't find variable: HeroBullet' in this line: 'var bullet = new HeroBullet();' Line Number: 19
User prompt
Power ups make you shoot in a spread
User prompt
Make enimies drop power ups that make you stronger for 1 minute e.g spread shot, laser, bomb
User prompt
Remove the boss system
User prompt
Give all enemies health bars that increase by one every 3 waves
User prompt
Create a separate asset for the boss
User prompt
Add a skip to wave 5 button above the debug menu
User prompt
Move the debug menu up higher
User prompt
Add a debug menu above the joystick
User prompt
Add a bossfight on wave five that shoots a spread of projectiles
User prompt
Fix Bug: 'ReferenceError: Can't find variable: waveTxt' in this line: 'waveTxt.setText('Wave: ' + currentWave);' Line Number: 250
User prompt
Add a wave display
User prompt
Show the wave in the top left
User prompt
Make a boss spawn every 5 waves instead of at 50 score
User prompt
Add a wave system
User prompt
Fix Bug: 'TypeError: undefined is not an object (evaluating 'self.lives = 3')' in this line: 'self.lives = 3;' Line Number: 65
User prompt
Fix Bug: 'TypeError: undefined is not an object (evaluating 'self.lives = 3')' in this line: 'self.lives = 3;' Line Number: 65
User prompt
Make a boss that fires in a spread and has 3 lives, but only comes out every time you get 50 points
User prompt
Give the player 5 lives
User prompt
Make the enemies get stronger for every 50 points you get
User prompt
Change the games background to look like mars
User prompt
Make the background look like Earth
User prompt
Add a shoot button on the right of the screen
User prompt
Joystick for movement
Initial prompt
Hyper Shootout
===================================================================
--- original.js
+++ change.js
@@ -23,8 +23,34 @@
bullets.push(bullet);
self.bulletCooldown = 20; // Cooldown period before next shot
}
};
+ self.powerUpTimer = 0;
+ self.powerUpActive = false;
+ self.enableSpreadShot = function () {
+ self.powerUpActive = true;
+ self.powerUpTimer = 3600; // 1 minute at 60FPS
+ // Additional logic for spread shot effect
+ };
+ self.enableLaser = function () {
+ self.powerUpActive = true;
+ self.powerUpTimer = 3600; // 1 minute at 60FPS
+ // Additional logic for laser effect
+ };
+ self.enableBomb = function () {
+ self.powerUpActive = true;
+ self.powerUpTimer = 3600; // 1 minute at 60FPS
+ // Additional logic for bomb effect
+ };
+ self.updatePowerUpTimer = function () {
+ if (self.powerUpTimer > 0) {
+ self.powerUpTimer--;
+ if (self.powerUpTimer == 0) {
+ self.powerUpActive = false;
+ // Reset hero's shooting ability to normal
+ }
+ }
+ };
self.update = function () {
if (self.bulletCooldown > 0) {
self.bulletCooldown--;
}
@@ -67,8 +93,32 @@
self.move = function () {
self.y += self.speed;
};
});
+// PowerUp class
+var PowerUp = Container.expand(function () {
+ var self = Container.call(this);
+ var powerUpGraphics = self.createAsset('powerUp', 'Power up', 0.5, 0.5);
+ self.type = 'spread'; // Default power-up type
+ self.speed = 2;
+ self.move = function () {
+ self.y += self.speed;
+ };
+ self.applyEffect = function (hero) {
+ // Apply the effect based on power-up type
+ switch (self.type) {
+ case 'spread':
+ hero.enableSpreadShot();
+ break;
+ case 'laser':
+ hero.enableLaser();
+ break;
+ case 'bomb':
+ hero.enableBomb();
+ break;
+ }
+ };
+});
// DebugMenu class
var DebugMenu = Container.expand(function () {
var self = Container.call(this);
var menuGraphics = self.createAsset('debugMenu', 'Debug menu', 0.5, 0.5);
@@ -170,8 +220,9 @@
// Initialize important asset arrays
var bullets = [];
var enemies = [];
var enemyBullets = [];
+var powerUps = []; // Store active power-ups
var score = 0;
var hero = game.addChild(new Hero());
hero.x = 1024; // Center of the screen
hero.y = 2732 - 200; // Near the bottom of the screen
@@ -207,8 +258,18 @@
} else {
// Check for bullet collision with enemies
for (var j = enemies.length - 1; j >= 0; j--) {
if (bullets[i].intersects(enemies[j])) {
+ if (Math.random() < 0.2) {
+ // 20% chance to drop a power-up
+ var powerUpTypes = ['spread', 'laser', 'bomb'];
+ var powerUp = new PowerUp();
+ powerUp.type = powerUpTypes[Math.floor(Math.random() * powerUpTypes.length)];
+ powerUp.x = enemies[j].x;
+ powerUp.y = enemies[j].y;
+ game.addChild(powerUp);
+ powerUps.push(powerUp);
+ }
enemies[j].destroy();
enemies.splice(j, 1);
bullets[i].destroy();
bullets.splice(i, 1);
@@ -239,8 +300,22 @@
enemyBullets[k].destroy();
enemyBullets.splice(k, 1);
}
}
+ // Move and check power-ups
+ for (var m = powerUps.length - 1; m >= 0; m--) {
+ powerUps[m].move();
+ if (powerUps[m].y > 2732 + powerUps[m].height) {
+ powerUps[m].destroy();
+ powerUps.splice(m, 1);
+ } else if (powerUps[m].intersects(hero)) {
+ powerUps[m].applyEffect(hero);
+ powerUps[m].destroy();
+ powerUps.splice(m, 1);
+ }
+ }
+ // Update hero's power-up timer
+ hero.updatePowerUpTimer();
// Move enemies and potentially shoot
for (var l = enemies.length - 1; l >= 0; l--) {
enemies[l].move();
if (Math.random() < 0.01) {
A laser. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A laser bullet. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A plus sign. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A mechanical wasp. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A turret. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.