Actionscript 3 Lightning class – First tests

actionscript 3, advanced image editing, algorithms, fun, game, Math, perlinNoise, Physics, simulation

Here again with the first test of a Fx class.

The class can render lightnings with these specs:

- different shapes and aspect
- variable edge-smoothness to keep the extremities sticked to the origin
- runtime children generation (every trunk can generate children)

Sample #1

Sample #2

Perhaps not that useful but could be nice to implement in some game or demo.
Code soon.



  1. Og2t  •  Apr 23, 2009 @9:12 am

    This is awesome Pierluigi, do you use Perlin Noise for that at all?

  2. DiseƱo Web Valencia  •  Apr 23, 2009 @9:59 am

    Its cool, Im waiting the code. Thanks

  3. benny!  •  Apr 23, 2009 @11:56 am

    Very nice looking effect. Good work!

  4. Pierluigi Pesenti  •  Apr 23, 2009 @1:04 pm

    Glad you like it. There are many perlinNoise here, two for every energy line. One for the macro and one for the micro, the one used for the macro variations is realtime smoothed by a simple function I’ll post, to keep the extremities sticked to the origins.

  5. Andy Kim  •  Apr 23, 2009 @9:38 pm

    Very very nice. I’m quite ready to sink my teeth into the code to learn :)

  6. dVyper  •  Apr 24, 2009 @1:59 pm

    This is excellent – can’t wait to see your method!!!

  7. Milan  •  Nov 11, 2009 @12:56 pm

    dude is there a possibility you could send me your first code linking the lightning between the two crosses?

  8. Pierluigi Pesenti  •  Nov 12, 2009 @4:59 pm

    I answered your mail. Bye

  9. Peter Ochabski  •  Sep 18, 2010 @8:20 am

    Have some great ideas to base on this pls send me any working code you’re willing part with and I’ll give you a link on the site im working on. Thanks for keepin it open!

  10. Peter Ochabski  •  Sep 19, 2010 @9:52 am

    Got it, thnx! Will send you a link soon!

  11. Tom  •  Feb 15, 2011 @3:54 pm

    Hello Pierluigi
    wow, you did amazing work and I’m fascinated by the way you did that. Is there a way to get the sourcecode of your first example on this page (the one with the ligthning between the two crosses) to play with and to learn how it works? That would be great!
    Thanks for sharing your ideas and keep up the good work!


2 Trackbacks

Leave a Reply

Allowed tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>