randomgeon/combat/projectiles/rock/scripts/rock_projectile.gd

19 lines
482 B
GDScript

class_name RockProjectile
extends ProjectileBaseTwo
func _ready():
lifetime_timer = Timer.new()
add_child(lifetime_timer)
lifetime_timer.one_shot = true
lifetime_timer.wait_time = lifetime
lifetime_timer.connect("timeout", _on_lifetime_timeout)
lifetime_timer.start()
emit_signal("on_spawned", self)
connect("body_entered", _on_body_entered)
func _physics_process(delta):
position += direction * speed * delta
func _on_lifetime_timeout():
super._on_lifetime_timeout()