[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] more list problems
- To: pygame-users@xxxxxxxx
- Subject: [pygame] more list problems
- From: "Eric Hunter" <hunter.eric1@xxxxxxxxx>
- Date: Thu, 20 Sep 2007 20:18:14 -0400
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Thu, 20 Sep 2007 20:18:23 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; bh=lKkR3OtFslz8YzgXvKY2StM7kCNw9t/szCPznkZYnFA=; b=mfMplokJGHlnqFKSGuF9m40uX2OUD7VKlwrtm+YT/nrl1NsntmXyCDkBT3MTCyhgkepdiWENu5nJyoW2im5zsGUUaRVDuOhmdUoyD276778FmHatv/klGd3LFOofJex5WXEJUh2emIDarVHWnDhPNhPf87btyaWE/H6ApssJJ0E=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type; b=cXrd7LBXQWzgBuqFI4CrpW+q0+tifioIbTEjX7pq/sl6nxIwXAYanzTHxWpLfsQCJ0PDiVKuAfGaBzcIVtfHlnn/qSHdJU/sMy/xJ1agIlwOVRuXqny7/v7t+8N83Xr/rsgzwfcBtES+WqJkiW4EOz5IEvfCZJ0mUw35JCpkV1I=
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
so I have been able to write pygame.Rect rectangles into rect-type lists. but now I'm trying to delete unwanted rectangles that are printed to the screen.
when I draw one at a time, I can only delete the last drawn rectangle before deleting the previous ones. I want to be able to delete any rectangle at any time without problems. I've come close but have run into a wall.
below is the "deleting rect" section. if anyone needs more then what's provided i can provide it upon request.
thanks in advance.
[code]
if event.button == 3:
mousexTEMP, mouseyTEMP =
pygame.mouse.get_pos()
for i in range(0, len(rect)):
if rect[i].collidepoint(mousexTEMP, mouseyTEMP):
del rect[i]
numRect -= 1
[/code]