[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] Re: Newbie Question - Stacking Sprites
- To: pygame-users@seul.org, kevin@movieextras.ie
- Subject: [pygame] Re: Newbie Question - Stacking Sprites
- From: Pete Shinners <pete@shinners.org>
- Date: Wed, 21 Jan 2004 08:11:47 -0800
- Delivered-to: archiver@seul.org
- Delivered-to: pygame-users-outgoing@seul.org
- Delivered-to: pygame-users@seul.org
- Delivery-date: Wed, 21 Jan 2004 11:13:54 -0500
- In-reply-to: <20040121150219.00F2D33CAA@moria.seul.org>
- References: <20040121150219.00F2D33CAA@moria.seul.org>
- Reply-to: pygame-users@seul.org
- Sender: owner-pygame-users@seul.org
- User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031107 Debian/1.5-3
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