Jump to content

Form words using particles on click


heisenthurg
 Share

Recommended Posts

I am looking for some ideas on how I would approach an idea I have, if anyone can help! 

I would like to have particles follow my mouse around the screen, which i have already figured out. However, once I click on the screen, I would like the particles to form a specific word. I am trying to figure out how I would do this. Is there some way of using paths to make the particles move into position? Or can I give each specific particle a position to move into when I click?

Any idea's would be great, thanks in advance!

Link to comment
Share on other sites

I'm not up to date with Phaser, but looking at the examples:

for (var i = 0; i < emitter.total; i++)
{
    if (emitter.children[i].visible)
    {
        //  Uncomment this to see the physics bodies
        // game.debug.body(emitter.children[i]);
    }
}

 

So you can just set the x/y for any particle you like (they're just Sprites). Use a tween to get there. I guess I would display the word in a buffer somewhere, and then just use random to select non zero pixels,  change the pixel value to 0 if selected, and then move the particle on the actual display. Tweak a bit to make sure all pixels are shown...

But that's just of the top of my head, maybe there are better ways...

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...