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

Re: [pygame] Collision bounds smaller than sprite image



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.