[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Re: Collision bounds smaller than sprite image



Yeah, because the other option is to make two or more collision masks
and then XOR them together to find the difference, and this is very
expensive in terms of clock-cycles.


On Fri, 31 Dec 2004 14:32:18 +0000, Austin Haas <pygame@xxxxxxxxxxxxxxxx> wrote:
> I've heard that in shooters, they always make the collision rect for your ship
> smaller than the graphic, and the rect for your enemies larger. Otherwise,
> players tend to feel like they are being cheated when a bullet barely touches
> them and kills them.
> 
> On Friday 31 December 2004 07:15 pm, Lee Harr wrote:
> > >Yeah, the more I think about it, the more I think that creating a
> > >second rect and storing it as an attribute is the way to go.  All of
> > >the graphical adjustments and movements will be performed with the
> > >normal rect attribute, and the actual collision and bounds tests will
> > >be done with the collision_rect.
> >
> > That is how I did it in pygsear:
> > http://www.nongnu.org/pygsear/
> >
> > (except I called it spriteobj.crect  :o)
> >
> > >  I guess it's not really that hard,
> > >but I was really exhausted after writing a strip -> cel routine :D
> >
> > Interesting ... I have been thinking about writing such a beastie
> > for pygsear for the last few weeks... are you releasing your code?
> >
> > _________________________________________________________________
> > Express yourself instantly with MSN Messenger! Download today it's FREE!
> > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
> 


-- 
Andrew Ulysses Baker
"failrate"