Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Particle Emitter for Explosion?
Started by Xorcist Jul 31 2019 02:29 PM

3 replies to this topic
particle emitter explosion
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

Xorcist

[GLOBAL: userInfoPane.html]
Xorcist
  • Observer

  • 11 posts
  • Corona SDK

Does anyone have an example of using a particle emitter for an explosion effect? I'm just learning the particle emitter system (completely new to it), but the sample emitters bundled with Corona don't seem to show how to accomplish this.

 

Does it make sense to use an emitter for this? or would this be better done with a standard sprite animation?



[TOPIC: post.html]
#2

XeduR @Spyric

[GLOBAL: userInfoPane.html]
XeduR @Spyric
  • Contributor

  • 822 posts
  • Corona SDK

Whether you want to use particles or sprites completely depends on your goals and you desired art style for your game.

 

You can check out http://particle2dx.com/ for what kind of explosion effects you could create with particles. Then, just load them into Corona (see documentation).



[TOPIC: post.html]
#3

Xorcist

[GLOBAL: userInfoPane.html]
Xorcist
  • Observer

  • 11 posts
  • Corona SDK

Thanks that site helped a lot.



[TOPIC: post.html]
#4

Xorcist

[GLOBAL: userInfoPane.html]
Xorcist
  • Observer

  • 11 posts
  • Corona SDK

So I did implement my explosions with an emitter, but I have a follow up question.

 

Is this is proper way to be inserting my emitter into my Scene (so I don't create a memory leak):

  function scene:create(event)
    local sceneGroup = self.view
    mainGroup = display.newGroup();
    sceneGroup:insert(mainGroup);
    emitter = display.newEmitter(emitterParams);
    sceneGroup:insert(emitter);
  end

* mainGroup, emitter, and emitterParams (loaded from a json file) are all globally declared.

 

** also note, I do use mainGroup for all my sprites (I just didn't show that here).




[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: particle, emitter, explosion