the-crypt/magic/Wands/WandClass.gd

12 lines
341 B
GDScript3
Raw Normal View History

2020-07-19 18:36:36 -05:00
extends Sprite
2020-07-19 23:16:44 -05:00
class_name Wand
2020-07-19 18:36:36 -05:00
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