despawn projectile instead of weird movement
This commit is contained in:
+2
-5
@@ -37,11 +37,8 @@ export default class Ability {
|
|||||||
effect: function straightShotEffect(caster, cursor) {
|
effect: function straightShotEffect(caster, cursor) {
|
||||||
const ability = this
|
const ability = this
|
||||||
const straightShotCollision = function straightShotCollision(projectile, collidingEntity) {
|
const straightShotCollision = function straightShotCollision(projectile, collidingEntity) {
|
||||||
if (!projectile.memory.hit) {
|
collidingEntity.damage(ability.damage)
|
||||||
collidingEntity.damage(ability.damage)
|
projectile.despawn()
|
||||||
projectile.memory.hit = true
|
|
||||||
projectile.destination = collidingEntity.position.clone()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const projectile = new Projectile({
|
const projectile = new Projectile({
|
||||||
|
|||||||
Reference in New Issue
Block a user