AreaSpawner
Inherits: Area2D < CollisionObject2D < Node2D < CanvasItem < Node < Object
Spawns Scene as siblings continously in intervals with the option to have multiple spawns in the run. The scene is spawned in a random location inside any of the CollisionShape2D children.
Warning: If any CollisionShape2D is not a RectangleShape2D, it will be ignored.
Properties
|
||
|
||
|
||
|
||
|
Methods
void |
_ready() |
void |
_physics_process(delta: float) |
void |
begin() |
void |
end() |
void |
spawn() |
Property Descriptions
Array[Node] all_children = get_children() 🔗
Lists all children at runtime. Only these will be used used to determine location. You should manually refresh this if you want to dynamically generate any CollisionShape2D.
Array[PackedScene] Scenes 🔗
The scenes to spawn. A Random scene will be picked from here to be spawned.
When set to true, it will automatically begin spawning as soon as it enters the tree.
Scenes spawned per Second.
Number of scenes spawned at the very first run.
The time passed since the last spawn.
A boolean to turn spawning on and off.
Method Descriptions
void _ready() 🔗
There is currently no description for this method. Please help us by contributing one!
void _physics_process(delta: float) 🔗
There is currently no description for this method. Please help us by contributing one!
void begin() 🔗
Start spawning.
void end() 🔗
Stop spawning and self-destruct. To pause spawning, simply set spawning to false.
void spawn() 🔗
The spawn function, use this to randomly spawn a scene from the Scenes array.