Get Updates By E-mail 

Article Written By:
Johann Dowa

Example: Create A Lightning Effect In Cocos2D Using OpenGL ES

  •  
  •  
  •  
  •  
  •  

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.

This was originally discussed on the Cocos2D forums here and you can find the original class from Mobile Bros on their website here.

A very nice lightning effect.


  •  
  •  
  •  
  •  
  •  

Submit A Resource

Have you created a useful tutorial, library or tool for iOS development that you would like to get in front of our 300,000+ monthly page views from iOS developers?

You can submit the url here.

The resources we feel will appeal to our readers the most will be posted on the front page.

Comments