User prompt
When curving bullets set the rotation based on speedX and speedY
User prompt
When curving bullets, first define speedX and speedY variables before applying them to self.x and self.y
User prompt
Add 90 degrees to bullet rotation when curving
User prompt
When curving bullets rotate the bullet to show the direction it's flying in
User prompt
decrease the impact of bullet curve
User prompt
Decrease the impact of bullet curve
User prompt
Only curve bullets on the x axis
User prompt
When collecting a curve bullet powerup, add one to the hero curvebullet variable
User prompt
Change hero.curveBullet to an integer as well
User prompt
Inside the nearestEnemy.enemy check, also subtract self.speed from self.y
User prompt
Decrease the impact of bullet curving
User prompt
Make hero bullet curving an integer, where a larger integer allows the bullet to curve more aggressively towards the enemies
User prompt
parse the information if a bullet should curve into the bullet instance when creating it
User prompt
Make sure powerups have a curvebullet type
User prompt
Fix Bug: 'ReferenceError: Can't find variable: hero' in this line: 'if (hero.curveBullet && enemies.length > 0) {' Line Number: 52
User prompt
Parse the enemies array to hero bullet to make sure the curve code works
User prompt
Add a powerup that makes hero bullets curve towards the nearest enemy a bit
User prompt
Write what wave we are playing at the center of the screen for 2 seconds each time a wave starts
User prompt
set heroBullet to null after destroying it
User prompt
Make sure both heroBullet and enemy exist before doing the intersection check
User prompt
Use Verdana for the poweruplabel font
User prompt
Divide the shield alpha by two
User prompt
Make the hero shield alpha be based on how much shield health you have left
User prompt
When spawning enemy bullets, subtract the Math.PI / 2 rather than adding it
User prompt
Rotate the enemy bullets such that they face the direction they are flying
===================================================================
--- original.js
+++ change.js
@@ -71,9 +71,9 @@
if (nearestEnemy.enemy) {
var angle = Math.atan2(nearestEnemy.enemy.y - self.y, nearestEnemy.enemy.x - self.x);
speedX = self.speed * Math.cos(angle) * self.curveBullet * 0.1;
speedY = -self.speed;
- self.rotation = angle + Math.PI / 2;
+ self.rotation = Math.atan2(speedY, speedX) + Math.PI / 2;
}
}
self.x += speedX;
self.y += speedY;
Round powerup. Shield icon Single Game Texture. In-Game asset. 2d. Pixelart. White background. Blank background. Low detail. High contrast.
Extra missile powerup circle. Missile and plus sign. Single Game Texture. In-Game asset. 2d. Pixelart. White background. Blank background. Low detail. High contrast.
Single space torpedo flying upwards Game Texture. In-Game asset. 2d. Pixelart. White background. Blank background. Low detail. High contrast.
Background galaxy nebulas and galaxies Single Game Texture. In-Game asset. 2d. Pixelart. White background. Blank background. Low detail. High contrast. --ar 1:10
Round powerup. Green health icon Single Game Texture. In-Game asset. 2d. Pixelart. White background. Blank background. Low detail. High contrast.
Blue glowing powerup circle with s in center Single Game Texture. In-Game asset. 2d. Pixelart. White background. Blank background. Low detail. High contrast.
Round powerup. Lightning icon pointing up. Single Game Texture. In-Game asset. 2d. Pixelart. White background. Blank background. Low detail. High contrast.
Stylish hero spaceship facing upwards, with a single cannon in the center. Single Game Texture. In-Game asset. 2d. Pixelart. White background. Blank background. Low detail. High contrast.
single alien enemy spaceship facing down, looking like space alien adopted to living in space. Game Texture. In-Game asset. 2d. Pixelart. White background. Blank background. Low detail. High contrast.
Single enemy slime bullet, seen from above facing upwards. Single Game Texture. In-Game asset. 2d. Pixelart. White background. Blank background. Low detail. High contrast.
Round powerup icon with bullseye Single Game Texture. In-Game asset. 2d. Pixelart. White background. Blank background. Low detail. High contrast.
Clean plasma bubble Single Game Texture. In-Game asset. 2d. Pixelart. White background. Blank background. Low detail. High contrast.