Open Gadgetoid opened 4 years ago
Looks like the particle example has two copies of rain/smoke, one using the generator and one not (and the generator ones aren't used).
generator:
generate_smoke
/smoke_generator
/render_smoke
generate_basic_rain
/basic_rain_generator
/render_basic_rain
no generator:
smoke_generate
/smoke
rain_generate
/rain
Looking over ParticleGenerator and the particle example reveal several wrinkles that I think should be fixed.
Perhaps I'm overthinking the role of the particle generator here, but presently in the particle example it seems almost completely unused.
ParticleGenerator
generate_per_ms
andremaining_ms
are currently unused?ParticleGenerator
be managed by the engine in the same way that Timers/Tweens are?ParticleGenerator
not include separategenerate
,update
andrender
functions?It feels like
ParticleGenerator
should handle expiring old particles and calling the necessary function to generate new ones, but then call out to an anonymous function for the "update remaining particles" portion of its functionality.Perhaps
update
should beupdate_particle
andrender
should berender_particle
and these user functions can then only have to worry about operating upon a single particle:Particle Example
rain_generate
,rain
,generate_basic_rain
andbasic_rain_generator
interplay. Why so many named functions?basic_rain_generator
'supdate
function called?spark()
,smoke()
andrain()
not exist asupdate
andrender
functions on the ParticleGenerator itself?I would expect the code to feel something like this: