the-crypt/magic/Wands/WandClass.gd
2020-07-19 23:16:44 -05:00

12 lines
341 B
GDScript

extends Sprite
class_name Wand
func fire(projectile, effect):
if $ShootDelay.is_stopped() and projectile != null:
var temp = projectile.instance()
get_tree().current_scene.add_child(temp)
temp.global_transform = $ProjectileSpawn.global_transform
var energy_cost = temp.launch(null, null)
$ShootDelay.start()
return energy_cost