gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Coding > Simple sprite animation

#17721 - Lunarsoul - Sat Mar 13, 2004 5:01 am

Hi, I'm having some troubles with all the conversions tools and background modes of the GBA. Thus, I'm pretty confused. I'm currently using visualham and gfx2gba and trying to animate a character walking in 4 directions. However I have a set a 16x24 sprites in .gif. Can anyone give me a hint on how to actually use sprites into my project and be able to animate it as I want to ? (Right now I simply want the character to move in the 4 directions (3 sprites per directions) ) on a black blackground. Any help on this subject would be greatly apreciated.
Thanks.

#17722 - DarkPhantom - Sat Mar 13, 2004 8:11 am

Well first off, if you haven't already, checkout a reference/tutorial guide on GBA programming. There are many good one's available. www.thepernproject.com for one. It explains how to create sprites, convert them, load them into VRAM and then how to use them. I found it very informative when I had just started doing this.

You can't convert .gif files using gba2gfx (atleast not with the version I have) so first convert that file to a 256 color bitmap. You can do that easilly with photoshop. I would suggest using a 2D sprite layout as a opposed to a 1D layout because I find that much easier to work with. PERN can explain this in detail if you don't already know what it means.[/url]
_________________
"head straight for your goal by any means
there is a door that you've never opened
there is a window with a view you've never seen
get there no matter how long it takes"

-Theme of Shadow, Sonic Adventure 2

#17734 - Lunarsoul - Sat Mar 13, 2004 5:19 pm

Ah I see. Hopefully I have photoshop so that won't be a problem. Thank you for the help I will check out those tutorials right away.

#17737 - Lunarsoul - Sat Mar 13, 2004 6:39 pm

Oh btw, can someone please tell me how to draw a line on the GBA the simple way :(

#17741 - dagamer34 - Sat Mar 13, 2004 7:34 pm

Use the search function to find stuff like that. It makes it a lot easier when you need some code.

Here's a topic that talks about line drawing using Bresenham's algorithm, includes some code too:
http://forum.gbadev.org/viewtopic.php?t=1365&highlight=bresenham

And there are many more if you just search for them.
_________________
Little kids and Playstation 2's don't mix. :(

#17744 - Lunarsoul - Sat Mar 13, 2004 7:51 pm

Thanks a lot