Fork me on GitHub
Not signed in (Sign In)

Welcome, Guest

Want to take part in these discussions? Sign in if you have an account, or apply for one below

  1.  
    I'm experimenting with a game idea I came up with, it's rather simple, fireworks are launched into the sky, and the user must select them with the mouse and push a button to set them off.

    I was wondering if it were possible to make FLiNT particles respond to mouse click events, so that they can become "selected," as well as being able to some how control as state of being "selectable" and "non-selectable" as there is a minimum height they can be set off from on the screen to make the game more difficult.
    • CommentAuthorRichard
    • CommentTimeJun 17th 2010
     
    Flint's renderers have mouseEnabled and mouseChildren set to false by default, disabling mouse clicks. If you set these to true, you'll receive mouse clicks from the particles.

    renderer.mouseEnabled = true;
    renderer/mouseChildren = true;


    It is easiest to use the DisplayObjectRenderer for this, since each particle is a discrete display object so the target of the event is the individual image object. It will still be a little tricky mapping back from the image object to the particle that it represents. If you get stuck do ask again.