[Kde-games-devel] Kapman sprite system (also, connecting-tiles systems)

Matthew Woehlke mw_triad at users.sourceforge.net
Thu Dec 11 00:34:04 CET 2008


kleag at free.fr wrote:
> The solution in KsirK is intermediary: Everything is in one svg and
> there is one element with id by object but then all the frames of the
> object are in the same element. The information on how to cut the
> object in individual frames is found in the world.desktop file. I
> don't like to have parseable ids. For me, ids are atomic pieces of
> information.

People complained when I wanted to put that information in the .desktop 
;-). And TBH I think it is more convenient in the svg, but I'd welcome 
suggestions if someone thinks they have a better idea.

> The attached image shows the element with id "exploding"
> in the svg and its description in the .desktop is below: [exploding] 
> frames=4 height=32 id=exploding versions=2 width=32

I take it you *do* use pixmap splitting, then? I guess I should try to 
remember to give you a nudge if/when I have a usable frame-extracting 
class, I wonder if you would be interested. (Actually... I think you 
would be able to use it directly. I am already anticipating that it will 
need a method that takes maybe an id for reference point but raw offsets 
and width/height; you could certainly use that method with your existing 
id's, no offset, and calculated width/height to extract frames as in 
your sample.)

> The AnimSprite class is a QGraphicsPixmapItem and itr also contains a
> list of pixmaps for the frames. Then a slot connected to a timer
> (local to the sprite ; should it be global ?) calls setPixmaps
> regularly.

Oy. For Kapman, I was certainly planning to have a global timer (if I 
have to start implementing my own animation logic, anyway). I'm also 
assuming that it will allow skipped frames, so I am wanting to handle 
all animation globally. (But I guess you are dealing with sprite 
positioning/movement separate from animation, which simplifies things.)

Please keep in touch, it sounds like you could probably help me a bit on 
the actual animation side :-). Especially with possible code-sharing. I 
know how I want to get frames out of the svg, and what I want to be 
possible animation-wise, but rather less how to actually accomplish the 
animation ;-).

-- 
Matthew
Please do not quote my e-mail address unobfuscated in message bodies.
-- 
"Who wants to sing?" -- Orcs (Warcraft II)



More information about the kde-games-devel mailing list