Projectile is actually a parent scene
This commit is contained in:
parent
d1db3ed693
commit
51ffebbf75
|
|
@ -18,6 +18,8 @@ func _ready():
|
||||||
func _process(delta):
|
func _process(delta):
|
||||||
rotate(delta * 10)
|
rotate(delta * 10)
|
||||||
position += direction_normal * velocity_pps * delta
|
position += direction_normal * velocity_pps * delta
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
func _on_body_entered(body):
|
func _on_body_entered(body):
|
||||||
|
|
@ -28,3 +30,7 @@ func _on_body_entered(body):
|
||||||
|
|
||||||
func _on_area_entered(area):
|
func _on_area_entered(area):
|
||||||
pass # Replace with function body.
|
pass # Replace with function body.
|
||||||
|
|
||||||
|
|
||||||
|
func _on_VisibilityNotifier2D_screen_exited():
|
||||||
|
queue_free()
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,12 @@
|
||||||
|
|
||||||
[ext_resource path="res://src/classes/projectile.gd" type="Script" id=1]
|
[ext_resource path="res://src/classes/projectile.gd" type="Script" id=1]
|
||||||
|
|
||||||
[node name="Projectile_Template" type="Area2D"]
|
[node name="Projectile" type="Area2D"]
|
||||||
monitorable = false
|
monitorable = false
|
||||||
script = ExtResource( 1 )
|
script = ExtResource( 1 )
|
||||||
|
|
||||||
|
[node name="VisibilityNotifier2D" type="VisibilityNotifier2D" parent="."]
|
||||||
|
|
||||||
[connection signal="area_entered" from="." to="." method="_on_area_entered"]
|
[connection signal="area_entered" from="." to="." method="_on_area_entered"]
|
||||||
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
||||||
|
[connection signal="screen_exited" from="VisibilityNotifier2D" to="." method="_on_VisibilityNotifier2D_screen_exited"]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user