the-crypt/magic/Beams/WaveBeam.gd

14 lines
312 B
GDScript3
Raw Normal View History

2020-07-21 17:49:04 -05:00
extends Beam
func _ready():
energy_cost = 2
damage = 1
func get_collider():
2020-07-21 18:08:31 -05:00
$FireSound.play(0.0)
2020-07-21 17:49:04 -05:00
var c = $RayCast2D.get_collider()
if c != null and c.has_method("get_type") and c.get_type() == "enemy":
print("knock")
c.do_knockback($RayCast2D.get_collision_normal())
return $RayCast2D.get_collider()