===================================================================
--- original.js
+++ change.js
@@ -509,29 +509,34 @@
});
self.update = function () {
self.graphics.rotation += WEAPON_CROSS_ROTATION;
if (!isPaused) {
- self.moveInDirection(config.direction, speed);
// Grow the projectile
if (config.growthRate > 0) {
growth += config.growthRate;
scale = config.scale * growth;
self.graphics.scale.x = scale;
self.graphics.scale.y = scale;
self.setRadius(WEAPON_CROSS_RADIUS_BASE * scale);
}
+ // Move projectile
if (range <= 0) {
if (speed > -WEAPON_CROSS_SPEED_BASE) {
if (speed <= 0 && linger-- > 0) {
speed = 0;
} else {
+ var direction = Math.atan2((hero.y - self.y) / GAME_PERSPECTIVE, hero.x - self.x);
speed -= WEAPON_CROSS_SPEED_DECREMENT;
+ self.moveInDirection(direction, -speed);
}
} else {
+ var direction = Math.atan2((hero.y - self.y) / GAME_PERSPECTIVE, hero.x - self.x);
speed = -WEAPON_CROSS_SPEED_BASE;
+ self.moveInDirection(direction, -speed);
range -= Math.abs(speed);
}
} else {
+ self.moveInDirection(config.direction, speed);
range -= Math.abs(speed);
}
// Check for hits and deal damage
var currentTick = LK.ticks;
@@ -546,10 +551,10 @@
LK.getSound('weaponCrossImpact').play();
}
}
}
- // Destroy the projectile
- if (speed <= 0 && self.intersectsInstance(hero) || range < -config.range && !checkBounds(self.x, self.y, WEAPON_CROSS_BORDER)) {
+ // Destroy the projectile when it returns
+ if (range <= 0 && hero.intersectsPoint(self.x, self.y)) {
self.callDestroy();
}
}
};
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