the-crypt/magic/Beams/WaveBeam.gd
2020-07-21 18:08:31 -05:00

14 lines
312 B
GDScript

extends Beam
func _ready():
energy_cost = 2
damage = 1
func get_collider():
$FireSound.play(0.0)
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()