Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Question about animation.

Author
Message
Wizz
15
Years of Service
User Offline
Joined: 27th Apr 2009
Location:
Posted: 23rd Aug 2009 21:11
I want to know how to make an animation that plays only once. Like an explosion. In the TGC folder i found a series of pictures that represent an explosion if displayed one after another. How is that done?

I just love the smell of code in the morning...
dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 24th Aug 2009 07:17
If by series of pictures you mean separate images for each frame and not a sprite sheet then you can just load up all the explosion images beforehand and create a plane whenever you need an explosion(then position it somewhere and point it at the camera) and increment some value representing the age of it and apply a different image each time this value goes past a step of say 0.1 seconds. It may be beneficial to wrap such functionality into a class to make it reusable though.

Wizz
15
Years of Service
User Offline
Joined: 27th Apr 2009
Location:
Posted: 24th Aug 2009 23:05
Yes i meant separate images for each frame... Ok, i'm guessing a plane is something you use in a 3D environment right? I'm trying to use this in 2D for once. So you say the only way to do this is to write a function with dbTimer? So there is nothing similar to "dbCrateAnimatedSprite" to make this a bit simpler?

I just love the smell of code in the morning...

Login to post a reply

Server time is: 2024-11-20 17:48:07
Your offset time is: 2024-11-20 17:48:07