[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] Layered Sprite Groups within Layered Sprite Groups
- To: pygame-users@xxxxxxxx
- Subject: [pygame] Layered Sprite Groups within Layered Sprite Groups
- From: Andrew Barlow <andrew.barlow@xxxxxxxxx>
- Date: Thu, 1 Aug 2013 19:51:50 +0100
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Thu, 01 Aug 2013 14:51:58 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=/3z7mAB3ANRER049kLgA5rl8VmNnq7Sh/I5C0rF4NQg=; b=yYpAqKvQ9Pranu1DYNhhfo2EhFTdtcs54eO37Ow8Lhkx1q2WpdCeRdf6IiiKGBXQT7 Hn9ukrdGxq332VSPm+yAurxknXeri3sB5y+iFw3jT+Y0KFdG1RWIqj2t3wyYmMfdH2n9 B8mUpfDB1Q294tS7BZKb2pHrVA/MTkxme6BJ8W1S+YzYa4l35aKgEAgRE75zT+5JvdsJ rLBafUw3D3UMn02VPe5oSlupeHHyXzjixDe/aTbE62ZIyAzoI9H5SDMfXFqvtJj7cILR AdDMnBHkZVH81f3oAuudiI0h2v2BFb9Qnt7wjTp5r0GOl59omxPt5rF9IGf/LmuvuS+J I2Bw==
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
Hello,
Â
I'm back with another blitting / Sprite / Layer Group Issue!
Â
So, I've got a map which is on a grid (of course). This map has a layer group in it which is just the tiles. The tile sprites have a layer number (as per the DirtySprite documentation). This layer number is the Y axis of my grid (makes sense)!
Â
Â
However, to add an extra layer of flexibility, I am trying to make layers inside the tiles too! I'm hoping to have 3 layers for each tile (Background, Decoraction and Unit). So, currently i'm trying to make a LayeredDirty group inside each tile object, where each layer in that tile is a DirtySprite (like the tile itself). Then, when the tile is dirty, ITS OWN LayeredDirty group is redrawn to the tiles image property, which in turn should then be drawn when the maps LayeredDirty group is drawn later. However, at the moment, when the next layer in the Y axis is drawn, I just get black squares and only the top half of the tile above (the layering is clearly not working correctly).
Â
Hopefully all that makes sense (its very hot here at the moment, hard to make any sense in this heat)!
Â
This link below is from some rough code I've thrown about to try and get this to work!
Â
Â
Any help with this would be mega, I've been stabbing at it for about a week now!
Â
Cheers in advance