[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] Re: Newbie Question - Stacking Sprites



I am experimenting with a simple card orientated game. I place cards on the screen and I can move them with the mouse.

Now, I want to bring a card to the front when I select on it with the mouse.

Is it possible to do this. I created a single sprite group, and I use the add() method to add each new card.
Unfortunately for the built-in pygame sprite stuff, there is no way to control orientation. Fortunately it isn't difficult to enhance the groups to add z-ordering. In fact 'piman' has written an excellent new sprite tutorial that includes an ordered sprite render group.

http://kai.vm.bytemark.co.uk/~piman/writing/sprite-tutorial.shtml