2020-07-19 18:36:36 -05:00
|
|
|
extends Sprite
|
|
|
|
class_name Wands
|
|
|
|
|
|
|
|
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
|
2020-07-19 19:15:43 -05:00
|
|
|
var energy_cost = temp.launch(null, null)
|
2020-07-19 18:36:36 -05:00
|
|
|
$ShootDelay.start()
|
2020-07-19 19:15:43 -05:00
|
|
|
return energy_cost
|