[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[pygame] FW: BOUNCE: RenderPlain and new method in Sprite (suggestion)



-------- Original Message --------
From: Peter Gebauer <peter@restamus.org>
To: pygame-users@seul.org
Subject: RenderPlain and new method in Sprite (suggestion)

Hello.

I am very new to Python and PyGame, but I have written a lot of game 
engines
in C using various techniques and libraries, including SDL.

I realized that the Group class (and derived) all draw the sprites
in the dictionary directly from the RenderPlain.

But what if I want to change the drawing behaviour depending on what sprite
I'm drawing. Perhaps some sprites should be combined with
mask/blend/whatever. The best way is that each sprite must implement their
own draw. The simplest form of draw() method should be in the Sprite class,
a simple blit (like the one in RenderPlain) should be enough.

So RenderPlain (and any other Group that wants to call draw() on a Sprite)
should itterate the sprite dictionary, but instead of actualy doing 
anything
it should call the sprites draw() method, just like is done with update().

I think this would be a pretty good change, although it's not important. I
can always subclass RenderPlain to a Group that does this exactly.

Well, anyhow, pygame is looking really good and from what I've understood
Python is optimizable at C-level, so this is probably a good way of making
games!

Cheers,
	Peter


____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org