the-crypt/magic/Beams/WaveBeam.gd
2020-07-21 17:49:04 -05:00

13 lines
290 B
GDScript

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