Sprite animation

Hi I was just reading through messages, and I read about some
tutorials from Marius Andra. One google search later and I was reading
the tutorial on sprite animation.
(http://cone3d.gamedev.net/cgi-bin/index.pl?page=tutorials/gfxsdl/tut3)

This tutorial gives some code examples of some sprite classes.The
CSprite maintains a pointer to the screen.I was wondering what the
general consensus was about keeping a pointer to the screen in the
actual sprite class. Is this typical for 2D games, or do you think
this was done in this example for simplicity?

Thanks,

Jim

I won’t have a chance to pay full attention to the link until tomorrow.
However, I have begun, for my own purposes of a presentation, developing
a class I call SCR_Object. The pointer to the screen is kept there and
I used to run a routine that made sure that all screen objects had a
pointer to the screen. Later I revised the pointer to be a static
object. That essentially makes only one copy that can be seen by all
objects of the class. Ditto for the background. This prevents having
to pass the screen pointer to each object or relying on a specifically
named global screen pointer from having to be declared. Now all I have
to do is to initialize one object (I usually reserve the name of SCRSys
for this purpose) as if it were the screen object and the pointer is
automatically available to each object in the class.

Lilith

Hi I was just reading through messages, and I read about some
tutorials from Marius Andra. One google search later and I was
reading
the tutorial on sprite animation.

(http://cone3d.gamedev.net/cgi-bin/index.pl?page=tutorials/gfxsdl/tut3)>>> On 8/13/2006 at 1:21 PM, in message <42a3baf50608131121h12bba144o5b3d84d4c308f087 at mail.gmail.com>, xucaen wrote:

This tutorial gives some code examples of some sprite classes.The
CSprite maintains a pointer to the screen.I was wondering what the
general consensus was about keeping a pointer to the screen in the
actual sprite class. Is this typical for 2D games, or do you think
this was done in this example for simplicity?

Thanks,

Jim


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl