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

Re: [pygame] Collision bounds smaller than sprite image



Well, that's kinda what I'm talking about, but I'm more thinking like
the collision rect should be contained within the object instance. 
But, yeah, I like that distinction: collision_rect & render_rect.


On Wed, 29 Dec 2004 02:54:59 -0500, Matt Bailey <mattb@xxxxxxxxxx> wrote:
> Howdy Andrew,
> 
>   I've been giving this a bit of thought recently, as I will need to be
> shifting the collision rect from where the render rect is on background
> tiles for my 2D side scroller. I haven't tackled it yet, but right now
> whenever I do collision detection I get all "solid" rects from a
> list......I figure in my sprite classes of tiles that have solid rects,
> I'll just make another rect and append it to the "solid rect" list
> instead of appending the sprite's "default" rect. I'm sure others have
> more "tested" methods, I'm eager to hear what anyone else has on this as
> well. :)
> 
>              -Matt Bailey
> 
> andrew baker wrote:
> 
> >I'm currently working on my engine and want to be able to have sprites
> >with bounding and collision rectangles smaller than their actual
> >images  In this case, I want their lower areas (ie, their footprint)
> >to be the "rect" and behave exactly like the rect, but I still want
> >the whole image to be drawn without any odd behavior.
> >
> >
> >
> 
> 


-- 
Andrew Ulysses Baker
"failrate"