2020-07-19 17:19:31 -05:00
|
|
|
extends Projectile
|
|
|
|
|
|
|
|
func launch_right():
|
|
|
|
velocity = (Vector2.RIGHT * speed)
|
|
|
|
func launch_left():
|
|
|
|
velocity = (Vector2.LEFT * speed)
|
|
|
|
func launch_upleft():
|
2020-07-19 18:39:59 -05:00
|
|
|
velocity = (Vector2(1, -1).normalized() * speed)
|
2020-07-19 17:19:31 -05:00
|
|
|
func launch_upright():
|
2020-07-19 18:39:59 -05:00
|
|
|
velocity = (Vector2(-1, -1).normalized() * speed)
|
2020-07-19 17:19:31 -05:00
|
|
|
func on_impact(collision):
|
|
|
|
if collision.collider.has_method("get_type"):
|
|
|
|
collision.collider.set_health(collision.collider.get_health() - 1)
|
|
|
|
queue_free()
|