Get Updates By E-mail 

particle generator

Source Code: Particle Based Explosions In iPhone OpenGL ES

  •  
  •  
  •  
  •  
  •  

Hi everybody, if you’ve been following me on twitter you may have seen my tweet about an open sourced iPhone version of Space Invaders

If you haven’t seen it yet, it’s a very concise implementation of the classic game, and also a very basic implementation, but I noticed something pretty cool while playing with it, and that was the particle based explosions. So what I did was spend about 3 minutes playing with the code, and I came up with the demo shown here in this video.

To create these explosions a Particle Emitter created by the guys at 71 Squared (makers of some great iPhone game development tutorials) along with a custom texture class. 

To create the explosions a Particle Emitter is first created and initialized using the initParticleWithEmitter class, where you can specify parameters for the color, duration, size, number of particles, and gravity of the resulting display of particles (an example of this is in the EaglView.m file).

To display the particles a time index is created, and the update: method is executed along with the renderparticles method.  I won’t go into the details here as the ParticleEmitter classes are extremely well documented.

Download the source code for the explosion generator here:
>>> Explosion Generator Source <<<

Have fun with the code.

 


  •  
  •  
  •  
  •  
  •