1
Fork 0
mirror of https://github.com/Steffo99/swear-jar.git synced 2024-11-21 23:34:18 +00:00

Add spawned signal to spawner

This commit is contained in:
Steffo 2023-10-01 02:41:39 +02:00
parent e80e81b938
commit 8e83184150
Signed by: steffo
GPG key ID: 2A24051445686895

View file

@ -16,6 +16,8 @@ var buffer: int = 0
@export_flags_2d_physics var overlapping_bodies_collision_mask: int
@export_range(0, 16) var overlapping_body_count_limit: int
signal spawned(what: RigidBody2D)
func spawn():
buffer += 1
@ -45,6 +47,7 @@ func _do_spawn():
scene_instant.position = _select_spawn_position()
scene_instant.rotation_degrees = _select_spawn_rotation()
add_child(scene_instant)
emit_signal("spawned", scene_instant)
buffer -= 1