[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] lists of tuples
- To: pygame-users@xxxxxxxx
- Subject: [pygame] lists of tuples
- From: Luke Miller <dodgyville@xxxxxxxxx>
- Date: Sat, 10 Sep 2005 17:31:47 +1000
- Delivered-to: archiver@seul.org
- Delivered-to: pygame-users-outgoing@seul.org
- Delivered-to: pygame-users@seul.org
- Delivery-date: Sat, 10 Sep 2005 03:31:59 -0400
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=pmyEr4BuGoYNcoFY68KvoVKZK87y2Odoye9HBSI8iBR5cfANgXyTRwwPrb0+DGmw/Zs2TRNEF1sI4EVOUBK2ACIj5mNY2RJeR5fXgyzE0kqvAZyeqtpGDyz8AKxAjbEjjkBbPrj5LB87ci4rMm78wJjJ9orguLcu0jJ3oEd5Wqw=
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
Hello everyone!
I feel as though I have been posting a lot of questions here. However,
my game engine is almost complete and is very much worth it! (You'll
see ... you'll ALL see... BHWHAHAHA)
My question:
I have a list of tuples that contains references to data inside my
sprite class (in this case, their positions), I would like to edit the
data in the tuple and have it change the data in the sprite, but this
is proving difficult with immutable tuples.
An example of my list would be:
myList = [(sprite1.position, "text"), (sprite2.position, "outpt")]
I would like to do an operation something like:
myList[0][0] = (5,5) #I know this is wrong for so many reasons
and have the the sprite1.position set to (5,5).
Is this achievable the way the list of tuples is currently set up?
Thanks,
Luke