Re: [Super-tux-devel] Sprites image
Brought to you by:
wkendrick
From: Ingo R. <gr...@gm...> - 2004-04-09 18:25:04
|
Ricardo Cruz <ri...@ae...> writes: > Anyway, I can do the coding for that, but the hard work will be to put frames > together in one file... Not really hard work (it's really simple), but can > take time. Well, but I could do that. > > So, do you agree with this? No, not really. Having frames in seperate images is perfectly fine and since its already the way it is, it should stay that way. However what we really need is a way to define sprites in a file, something ala: (sprite (name "foo") (fps 20) (type 'loop) (image (file "foo1.png") (alignment 10 10)) (image (file "foo2.png") (alignment 10 20) (hflip #t)) (image (file "foo3.png"))) So that the game code only needs to do a Sprite("foo") and not hardcode all the images, alignment and frame-rate stuff into the code, which makes it quite hard to tweak animations and alignment. If needed one could easily add support for one-file animations to such an approach. Another thing that would be interested would be support for flipping the sprite at load time, instead of keeping a flipped version on the disk. > (another thing, there should be also a base class, called maybe Sprite, that > would be inherited by BadGuy and Player). Aehm, no. A player or badguy HAS a sprite, but IS NOT a sprite, ie. no inheritance, just make it a member variable or multiple if the sprite has different states. -- WWW: http://pingus.seul.org/~grumbel/ JabberID: gr...@ja... ICQ: 59461927 |