Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
Use Particle Candy with class button.lua — Gideros Forum

Use Particle Candy with class button.lua

yubaroyubaro Member
edited July 2015 in General questions
Someone knows on how to use Particle Candy to make things appear to EXPLODE when a button is clicked.

Case 1: When button pressed, make it explode (in a mass of particles)
Case 2: When button pressed, make an on screen object explode (in a mass of particles).

Thank someone to help me with this. I failed to make it work that way.

Comments

  • piepie Member
    @yubaro I've never used particle candy, but I think that the idea is to "trick" the user: hide the things that shoud explode behind a fancy explosion effect.

    here's a basic example I put together using TNT particle engine which is open source.

    Using particle candy you would have more options to make the visual effect, and maybe the api is a bit different.
    hope this helps :)
    zip
    zip
    explosionExampleTNTparticle.zip
    391K
  • Thanks @pie

    Particles Candy hoped to use but the developer does not respond to mail.

    I've been testing with TNT particle and looks very good.

    I have a problem when cleaning purposes, when many at once, there are times when the image freezes to explode and is not removed from display. Why is that?

    Thanks!
  • piepie Member
    edited August 2015
    @yubaro I should see the code to tell you, but I can guess a couple of reasons:
    1) too many things happening at the same time:
    you can try to delay the explosions a bit with something like
    Timer.delayedCall(10*(i-1),  function() 
    explode_function(i) end)
    where i is an id number from an "action-list" containing every explosion you need to trigger, and 10 are ms. it should be enough to give a breath to the CPU but too short to be noticed by player (of course, you need to make some tests).

    2) you are removing the parent of the emitter or the emitter itself before the particle emission has finished:
    if that is the case use the events cast by each emitter to know when you can remove them.

    ..but there could be other reasons :)

    edit: remember that particles are "heavy" by definition: as general rules keep their lifetimes as short as possible, and limit their number.
  • Thanks @pie, I will test this weekend, thanks for you help!
Sign In or Register to comment.