Re: [pygame] Rect collision by direction

2009-06-06 Thread Skizzaltix
Thanks! It's working like charm now. Thanks, everyone! --Skizzaltix Brian Song wrote: Diagonal collision detection seems to get a lot of people including myself the first time. If you haven't fixed it yet, the remedy will most likely require you to do 2 collision detections instead 1. Without

Re: [pygame] Rect collision by direction

2009-06-06 Thread Brian Song
Diagonal collision detection seems to get a lot of people including myself the first time. If you haven't fixed it yet, the remedy will most likely require you to do 2 collision detections instead 1. Without looking at your code, I'm gonna assume your doing collision detection on both axis at once.

Re: [pygame] Bitmask Collision Response

2009-06-06 Thread Michael George
One option I've been investigating is the use of convolutions for bitmask collision response. I've been using it for drag-and-drop collision response, but you might find it useful for other kinds of response as well. The way it works is as follows: if I have an object that's moving through a

Re: [pygame] Rect collision by direction

2009-06-06 Thread Skizzaltix
This works perfectly if the character is moving along only one axis, but if he/she is moving diagonally along a row of walls, both the "colliding from the side" and the "colliding from the top" if statements get triggered, and so the character ceases movement along both axes... Thanks for the he

Re: [pygame] Rect collision by direction

2009-06-06 Thread Tyler Laing
Sounds like you aren't canceling the downward vector of motion. Make sure that all vectors, left, right, down, etc, are made zero when a collision happens, THEN set them to the proper values if you want a bounce response. On Sat, Jun 6, 2009 at 8:41 AM, pymike wrote: > Hi, I wrote a tutorial on

Re: [pygame] Rect collision by direction

2009-06-06 Thread pymike
Hi, I wrote a tutorial on this: http://pymike.pynguins.com/?page=tutorials&id=1 HTH On Sat, Jun 6, 2009 at 1:33 PM, Skizzaltix wrote: > Hello, > I've been trying to find a way to, when detecting collisions between two > sprites, determine which side of one sprite is colliding with the other. > B

[pygame] Rect collision by direction

2009-06-06 Thread Skizzaltix
Hello, I've been trying to find a way to, when detecting collisions between two sprites, determine which side of one sprite is colliding with the other. Basically, I want to make it so that when a character walking to the left collides with a block to his/her left, he/she stops moving, but if

Re: [pygame] Bitmask Collision Response

2009-06-06 Thread pymike
Thanks! I've had a lot of good feedback on the art style. :) I'm prototyping collisions right now. I *think* I know how to do it. On Sat, Jun 6, 2009 at 9:04 AM, Kelvin Ho wrote: > Hi, > > I know it's completely off topic but that pic looks very nice. :) Style > reminds me of Patapon. > > Kelvin

Re: [pygame] Bitmask Collision Response

2009-06-06 Thread Kelvin Ho
Hi, I know it's completely off topic but that pic looks very nice. :) Style reminds me of Patapon. Kelvin On Sat, Jun 6, 2009 at 5:26 AM, pymike wrote: > The player needs to move out of a static bitmask. I's a platformer. :) > Concept Art: http://pymike.pynguins.com/downloads/ambito-concept-ar