[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pygame] Collision Detection -- Part 2



Hi Guyon,

I read very quickly through your code, but I have a strange impression.
That as soon as you are colliding with a wall you end up preventing
any movement from your bot just because it is colliding. Actually I think
your 5 pixel margin is your trouble.
Imagine you get to the point where you are colliding with the wall.
Even if you tried to make a movement to go back (let's say 1,2 pixels),
you would still be in your 5 pixel margin...
and as you reset your position to the old position, you get stuck.

You should better make a collision check with 0 pixel margin.

Have you already tried it?

cheers,

Guillaume

____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org