[pygame] Sprites false positive collision - newbie alert

2014-05-05 Thread AdamC
I'm having problems with sprites collision. I'm trying to use two different methods (not at the same time) to get success but each version is throwing up the same problem - each 'enemy' sprite is detected as colliding with the player and being deleted. I included the self.rect = self.image.get_re

Re: [pygame] Sprites false positive collision - newbie alert

2014-05-05 Thread Dominik George
Hi Adam, > What is the easiest way of detecting the collision between enemy and > player? > > TIA > > My whole code is visible at: > https://github.com/kabads/zoomr/blob/master/zoomr.py I went through your code and found it to be a bit strange. I guess you started using PyGame without sprites and

Re: [pygame] Sprites false positive collision - newbie alert

2014-05-05 Thread AdamC
Hi Nik, many thanks for your very detailed response. I will go through your amended code to see where I went wrong and correct the issues - all part of the learning curve. I'm also happy to see your completely cleaned-up version if you have time. Currently, I'm interested in where I went wrong wi

Re: [pygame] Sprites false positive collision - newbie alert

2014-05-05 Thread Sam Bull
On lun, 2014-05-05 at 09:19 +0100, AdamC wrote: > self.rect = self.image.get_rect() You assign that rect, but then use completely separate x and y attributes for the position. You then use the rect for collision, which because you haven't updated it, is still at position (0,0). Therefore all the r