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.

Newcomers DBPro Corner / sprite explosion

Author
Message
OnQue Int
17
Years of Service
User Offline
Joined: 8th Jun 2007
Location:
Posted: 27th Jan 2009 20:24
I have a sprite with 16 picrures on it how can i animate this i dont understand the uv thing in db how is this done
pollywog
17
Years of Service
User Offline
Joined: 18th Jan 2007
Location:
Posted: 27th Jan 2009 23:02
are you 2d or 3d?

if you are using 2d you can use the play sprite command.
I'm assuming you have a tile sheet with 16 frames.
I don't have dark basic in front of me right now but I think the
syntax is something like

create animated sprite 1, "explosion.bmp", 16,1,1
play sprite 1, 1, 16, 1

if you are 3d and trying to texture a plain with your explosion you could check the face demo that came with your install look at the fire part. I believe they run an animation on a plain in that example.
pollywog
17
Years of Service
User Offline
Joined: 18th Jan 2007
Location:
Posted: 28th Jan 2009 04:33
ok the 2d explosion was easy ( I used a 4x4 tilesheet)


but man your right running an animation on a plain is tough
I can get the first frame of the tilesheet to show up with



but I can't figure out how to move over to the next frame I thought I just needed a nested loop where I incremented by .25 since it is
a 4x4 tilesheet but that dog don't hunt.
scale object texture 1, .50, .25
scale object texture 1, .75, .25
scale object texture 1, 1, .25

I checked out the face demo but the way they did it was to chop up the tilesheet into ( in our case 16 seperate images) that seems like cheating

has anybody run an animation on a plain using a single tilesheet?
if so I'd love to know how to do it.
Kira Vakaan
15
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 28th Jan 2009 08:33
I think you've inspired me to do something ridiculous and over the top, but ah well.

I've written a small library of functions to help put tilesheet animations on planes. I'll paste the code below, but I've also attached the source file itself. I recommend including the file into whatever project you intend to use it in as opposed to copying and pasting it below your main source file code.



And so, with this library, you can now do something like this:



There's a description of all of the commands in the library in the comments at the top of the source file.

I hope this is useful to someone.

Attachments

Login to view attachments
lucifer 1101
15
Years of Service
User Offline
Joined: 26th Jan 2009
Location: Melbourne, Australia
Posted: 28th Jan 2009 08:40
let me be the first to thank you, even though atm i have no use for this it may become very useful when im doing a 2d game.

And one more thanks...
pollywog
17
Years of Service
User Offline
Joined: 18th Jan 2007
Location:
Posted: 28th Jan 2009 14:58
vira I contacted the vatican to have you nominated for beatification. mad props to you
pollywog
17
Years of Service
User Offline
Joined: 18th Jan 2007
Location:
Posted: 28th Jan 2009 15:02
oops sorry I meant kira

by the way completely off subject and has no reason to be included in this board (flame on me if you feel it necessary) but driving in to work there is this security guard at the front gate and he has the best beard ever! It has all these highlights, perfectly groomed...full yet not to thick I of course refer to him as super beard.

Of course now I have got to make a video game where super beard the security guard protects truth justice and the american way from all evil doers that would dare enter the front gate without authorization.
Kira Vakaan
15
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 29th Jan 2009 04:30
Awesome. I'm sure beatification will look good on a resume or something.

Glad you liked my library and I look forward to the adventures of Super Beard.
pollywog
17
Years of Service
User Offline
Joined: 18th Jan 2007
Location:
Posted: 29th Jan 2009 16:29
unfortunately I think you have to be dead to be considered a saint.
so that gets a bit sticky.
Kira Vakaan
15
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 29th Jan 2009 22:20
Bah, details.
pollywog
17
Years of Service
User Offline
Joined: 18th Jan 2007
Location:
Posted: 1st Feb 2009 01:40
ok I'm working on a game for the kids in my sunday school class.
it has to be done in two weeks but I'm pretty close. Anyway I added Kira's library and animation on plains to it.

by the way there is a kid in the sunday school we call corn dog hence the references. I didn't finish the game I need to tie in some questions about the subject they are covering and I didn't make an end for it yet but I thought you might want to see the explosion animations on the plain when you hit a landmine.

it is kind of a slalom game just drive the truck with through with the arrow keys, go through the slalom (boxes) the arrow above the truck should tell you where the next one is and avoid the land mines.

Login to post a reply

Server time is: 2024-09-28 02:31:58
Your offset time is: 2024-09-28 02:31:58