Repository navigation
Conversation
- There's no way to avoid code duplication with `GDCLASS` - The implementation will likely diverge for `Spawner2D` and `Spawner3D` anyway.
This may avoid potential confusion that switching `spawning` property may pause the internal delay and spawn timers, which is not the case.
Similar to `Particles2D.local_coords`, disabled by default because this would be mostly useful for spawning enemies, projectiles etc. Pushing local transform down to children by default would also cause physics bodies to jitter.
Similar to `RemoteTransform2D`. Those properties will be updated once upon node spawning. The `modify` word appears to better suited in this context, because `update` implies that transform may be updated each frame, which is not the case.
Prevents error spam and makes things not to blow up!
Just a greenish circle (from navigation), better than nothing!
Allows to customize the spawn destination within the scene. This is needed in cases where node hierarchy is crucial to functionality, for example: inserting `PolyNode2D` scenes to create explosion sequences.
There's a case when editor-only code returns `nullptr`, but we shouldn't disable the spawner every time, because launching the scene will always lead to disabled spawner at run-time (when saved). This reverts commit 2632286.
Made it work more like `Timer` now (backwards).
The signal is only emitted per time step, and not as a direct result of calling the function. This allows to prevent infinite loops when `spawn()` is called manually during `node_spawned` signal emission.
Contributor
Author
|
The core implementation is good enough I think, so lets merge this... See godotengine/godot-proposals#3651 (comment), I think it makes sense to introduce |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves godotengine/godot-proposals#3651.
goost_spawner_2d.mp4
Features
rateand timestepdelay, useful for implementing spawn waves.limitthe number of nodes spawned in order to automatically stop the spawner.Note that I'm not using
Timernodes for this at all, the timer logic is custom and allows for better integration and control.Spawner3Dcould be implemented similarly.To-do
Note that not everything below need to be implemented, this is rather a list of ideas.
node_spawnedsignal (whenspawn()is called, either manually or per timer) andfinishedsignal (whenlimit > 0).Position2Dto specify additional spawn points to override the default spawn at origin).Position2Din succession deterministically. This should be useful for things like explosion sequences.Particles2Danyways.Example project
https://github.com/goostengine/goost-examples/tree/gd3/2d/spawner