Lightning is one of those effects that is greatly sought after in 2D games, you can use it to set up a spooky scene, have a bolt of lightning shoot a player character, blow up a section of bricks or pretty much anything you can come up with.
I’ve come across a class that allows you to easily add a dynamic lightning effect to your Cocos2D games. This is done by directly drawing on the OpenGL ES scene so you could take this code, and easily modify it to work in any app that draws to the screen using OpenGL ES.
Here’s a demo of the class in action:
This version of the lightning class is from SupersuRacoon and can be downloaded through this post here: Simple Lightning Effect Demo. This version of the class allows you to set all strike points for the lightning effect.
A very nice lightning effect.