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 / createing animated sprite

Author
Message
bkbatman
13
Years of Service
User Offline
Joined: 6th Sep 2010
Location:
Posted: 6th Sep 2010 21:59
hey hello
the i need some help i would like to know like
how do i make a animated sprite like in one spot
standing the i am working on a sf game like this


[http://www.youtube.com/watch?v=6L9xkOfH8OU

the legendary master
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 7th Sep 2010 17:35
If you want to remake Street Fighter with DarkGDK you will need more than just an image of Ryu, you will need lots of sprite sheets for each animation for each character, do you have them?

If you are asking how to animate him then that is media creation and you would do better asking in another section, good luck, massive task

bkbatman
13
Years of Service
User Offline
Joined: 6th Sep 2010
Location:
Posted: 7th Sep 2010 21:55
bro i got mad sprite for ryu char
i am asking how u make a animation
i got the sprite for ryu
ken
akuma
in the folder
so i dont know what u talking about over here
i am talking about the animation code
so u just here to spam

the legendary master
Cuddle Bunniezzz 12
15
Years of Service
User Offline
Joined: 14th Jan 2009
Location: Buffalo, NY
Posted: 8th Sep 2010 00:24
Well, once you have created a sprite using dbCreateAnimatedSprite(), using a whole spritesheet, you use the dbPlaySprite() function to show animation.

http://ref.darkgdk.us/ <- Online DarkGDK Refernece. More content coming soon.
Greg_C
14
Years of Service
User Offline
Joined: 22nd May 2010
Location:
Posted: 8th Sep 2010 04:36
There is a pretty good example in the getting started documentation. It goes over doing an animated sprite and explains a little on how it works. Just make sure for your sprite sheet that it is divided evenly. For example you first need to find out which sprite in the sprite sheet is the biggest in height and width. the reason you do this is because how the create animated sprite works. It divides your image up by the number that you specify. So for instance if I did:



If you put 4 frames across and 1 frame down and you have a sprite sheet size of 80 width by 20height(saying that all 4 frames fit in this whole sheet) it will take the width of your image divide it by the frames across and then same with the height and then it will only draw the first sprite in the frame. It's a little hard to explain in words so go look at the example of the animated sprite from the getting started and I think you will understand if you are still having issues then just post it here and some one can help

Hope this helps.
bkbatman
13
Years of Service
User Offline
Joined: 6th Sep 2010
Location:
Posted: 8th Sep 2010 23:41
can someone please fix this code for me
so it can work with animated cause when i do it nothing show up


for ( int i = 2; i < 30; i++ )
{

// anime sprite go under here
dbCreateAnimatedSprite (i,"ryu\\02593.png", 1, 5, i);
dbCreateAnimatedSprite (i,"ryu\\02594.png", 1, 5, i);
dbCreateAnimatedSprite (i,"ryu\\025935.png",1, 5, i);
dbPlaySprite (i, 1, 5, 2);


dbSprite(i,100, 50, i);
// position our sprite at a random location
dbSprite ( i, dbRnd ( 450 ), -dbRnd ( 1500 ), i );
}

the legendary master
Cuddle Bunniezzz 12
15
Years of Service
User Offline
Joined: 14th Jan 2009
Location: Buffalo, NY
Posted: 9th Sep 2010 06:33
Well, your issue there is that you are creating the animated sprite over quite a few times, and that is quite bad, you only need to call the function once in your game. Along with the appropriate dbDeleteSprite() and dbDeleteImage() functions at the end.

And I don't think that filepaths work like that, try "ryu/02593.png", you might also be having issues when the .exe generated goes looking for the sprite.

I'd suggest putting them in the same directory as your .sln, and load the sprites like this in the code: "../02593.png".

Also, create a new 2D project (with the wizard), delete all the comments (they over commented it and made it a bit bulky), and just take a look at how the code works. Also try modifying some values to see what happens.

http://ref.darkgdk.us/ <- Online DarkGDK Refernece. More content coming soon.

Login to post a reply

Server time is: 2024-07-02 09:14:53
Your offset time is: 2024-07-02 09:14:53