Tell me more ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I've been thinking about using set of PNG images (representing frames) and continuously change between them to look like an animation.

Is there a simpler/better way? (maybe using GIF?)

share|improve this question
Every animation is 2D, because you are generating 2D table of pixels for 2D screen. – Ivan Kuckir May 12 at 12:44
3  
Do you have any experience with OpenGL? I think you don't. I recommend you to try some basic operations with OpenGL. – Ivan Kuckir May 12 at 12:45
@IvanKuckir I have experience with openGL, but only with 3D objects and 3D animations (using translation, roatation and scaling) and also with BMP textures. But now I am trying to create 2D game where I want to use animation made of images (gif like animation) – feri baco May 12 at 13:04
2  
Have You Checked Out Spritesheets? They Look Something Like This fabiobiondi.com/blog/wp-content/uploads/2012/08/… , and you load that one image in and draw a differant frame of it every game frame. – Potato May 12 at 13:44
2  
@feribaco: Welcome to GameDev.SE. "Is this the best way" type questions are not acceptable here. Thank you. – Nicol Bolas May 12 at 14:41
show 2 more comments

closed as not constructive by Anko, msell, Nicol Bolas, Byte56, Patrick Hughes May 12 at 15:41

As it currently stands, this question is not a good fit for our Q&A; format. We expect answers to be supported by facts, references, or specific expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, see the FAQ for guidance.

1 Answer

OpenGL can do more things that I care to shake a stick at in a comment. Among the thing it can do in relation to images is transform a given image (using shaders), clip an image and zoom an image(texture mapping).

So if what you want to do is create some kind of wavy mist, yes you can do this without drawing a million pictures of mist and loading them: You use a shader to calculate the motions procedurally on the GPU. Here is an example of creating waves using OpenGL

If on the other hand you want to do good old fashion sprite sheets for character animations for example, that's very valid as well, and you do it by taking one big image with all the steps in the animation and displaying part of the image every time. Here is an example of this being done in CSS

Excuse me for assuming, but if you need to ask this question you usually don't know enough about OpenGL to start using it right away. OpenGL is much harder than people are lead to believe. It might be a good idea to use some kind of library that uses OpenGL behind the scenes.

share|improve this answer
people often think that openGL knowledge gives them right to reckon themselves as the game programmers, but it is just the start and it is not such a secret as many people think....... – feri baco May 12 at 15:48

Not the answer you're looking for? Browse other questions tagged or ask your own question.