User prompt
duplicate the codeblock that checks for bullet intersections to destroy the bullet
User prompt
change the bullet destroy condition to: ((heroBullets[i].intersects(hero) && heroBullets[i].speed < 0) || ((heroBullets[i].x < 0 || heroBullets[i].x > 2048 || heroBullets[i].y < 0 || heroBullets[i].y > 2732) && heroBullets[i].travelDistance < -1000))
User prompt
center the score on the top of the screen
User prompt
destroy and remove bullets that go out of bounds while their traveldistance is < -1000
User prompt
while looping through all the heroBullets add a separate check that destroys and removes the bullet if it's out of bounds while it's travelDistance is less than -1000
User prompt
destroy bullets if they go out of bounds but only if their speed is < -1000
User prompt
remove the out of bounds check for bullets
User prompt
change the condition to destroy bullets: firstly on collision with the hero when speed < 0, secondly when out of bounds but only when travelDistance < -1000. Wrap each of these cases in brackets
User prompt
change the condition to destroy bullets: firstly on collision with the hero when speed < 0, secondly when out of bounds but only when travelDistance < -1000
User prompt
change the bullet destroy check to the following conditions: firstly on collision with the player, secondly when out of bounds but only if the travelDistance is < -1000
User prompt
destroy herobullets when they are out of bounds and have a traveldistance less than -1000
User prompt
destroy hero bullets that intersect with the hero or are both out of bound and it's traveldistance < -1000
User prompt
only destroy hero bullets that are out of bound if their travel distance is < -1000
User prompt
additionally check that travelDistance > 0 when trying to reduce bullet speed
User prompt
do not check travel distance before reduction
User prompt
bullet travel distance should always be reduced by the abs value of the speed
User prompt
change enemy move distance check from 50 to 100
User prompt
use an else instead of re-checking distance <= 50
User prompt
instead of enemies dealing damage to the hero on intersect, deal damage in the enemy's move function, if distance is <= 50
User prompt
when collecting a crucifix flash the screen white
User prompt
after clearing all the crucifix pickups break the for loop
User prompt
instead of destroying the collected crucifix pickup, destroy all of them
User prompt
when the hero touches a crucifix pickup it should destroy all enemies, all enemy bullets and all pickups
User prompt
Try spawn crucifixPickup first, if that fails then try spawn healthpickup
User prompt
instead of checking is there's a child instanceOf crucifixPickup, rather check that crucifixPickups length < 1
===================================================================
--- original.js
+++ change.js
@@ -156,9 +156,9 @@
if (!isPaused) {
hero.move();
for (var i = 0; i < heroBullets.length; i++) {
heroBullets[i].move();
- if (heroBullets[i].intersects(hero) && heroBullets[i].speed < 0) {
+ if (heroBullets[i].intersects(hero) && heroBullets[i].speed < 0 || (heroBullets[i].x < 0 || heroBullets[i].x > 2048 || heroBullets[i].y < 0 || heroBullets[i].y > 2732) && heroBullets[i].travelDistance < -1000) {
heroBullets[i].destroy();
heroBullets.splice(i, 1);
i--;
}
pixel art cross with blue accents Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a white orb. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a white orb with a halo. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a pulsating white heart with a halo. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a dark goo projectile with red highlights. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art tall blue fireball. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of an evil fantasy sword facing downward. Minor red details. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
backgroundAmbient
Sound effect
heroHealed
Sound effect
pickupExperience
Sound effect
heroLeveled
Sound effect
weaponCrossImpact
Sound effect
heroImpact
Sound effect
enemyDeath
Sound effect
pickupWeapon
Sound effect
pickupCrucifix
Sound effect
weaponCrossLaunch
Sound effect
heroDeath
Sound effect
enemyRoar
Sound effect
clockChime
Sound effect