★ TouchArcade needs your help. Click here to support us on Patreon.

how did they make the explosions in Geodefense?

05-29-2009, 05:49 AM
#1
Joined: Mar 2009
Posts: 659
how did they make the explosions in Geodefense?

The ones with the particles flying everywhere?

Can you do that by animating a bunch of tiny Objects or is that way too inefficient?
05-30-2009, 01:50 AM
#2
Joined: Feb 2009
Location: Sweden
Posts: 1,634
Why don't you ask him? He hangs around here in the forums.

I would do it with normal OpenGL lines, they are very fast.
05-30-2009, 03:38 AM
#3
Joined: Mar 2009
Posts: 659
I might have found the answer. Coco2d for iphone has a particle system class. Or you can make the particle system yourself using OpenGL.

I'm still new to iphone programming so I'm trying to figure out if games are mostly made using the UIkit classes or one level deeper.
05-30-2009, 03:51 AM
#4
Joined: Feb 2009
Location: Sweden
Posts: 1,634
OpenGL is just for graphics. It only contains pretty low level graphics operations, i.e. it lets you draw lines, shaded and/or textured triangles, helps with culling, transforms etc. In other stuff, you have to know your stuff, but you will also have total freedom to do whatever you want to do, which is not always the case with pre-made engines (I haven't used Coco2d so I don't know anything about it).

OpenGL does not load textures or meshes for you, it simply draws what you feed it and how you tell it to draw it. For good OpenGL tutorials, NeHe is a good start. I saw that someone had rewritten them for OpenGL ES (that's what you have on your iDevice): http://embedded.org.ua/opengles/lessons.html

A particle system is completely separated from graphics. In fact, it is good practice to separate graphics from logic (or physics in this case). You can write your particle system in any language (C, C++, ObjC), and let whatever system draw it (OpenGL, Coco2d etc).
05-30-2009, 05:22 AM
#5
Cocos2d wasn't used for GeoDefense although the developer is now using cocos2d. You are correct though, cocos2d's particle engine could be used for the type of effect you are after. Cocos2d is built on top of OpenGL ES and still gives you plenty of opportunity to dip down into low level coding if you require it.