[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] Turnable rect: collision checking
SB wrote:
> What I've done in the past is have multiple rects for a sprite. One
> would be it's proper Pygame Rect for blitting to the screen. Others
> might be rects for collisions or rects for attacks.
Well, I have thought of that but my problem is that it is quite a
large sprite with the shape of a parallelogram. It is not possible
to compute that of multiple rects.
> For the problem of turning sprites on various angles, I'd probably
> precompute the graphics for the various angles a sprite could face, and
> create a bunch of rects to approximate collisions
The graphics would be possible. I am thinking of a .collision method
that would check the pixels; if they are coloured, there is a collision...
but I have to go now.
yours,
Gerrit.
--
257. If any one hire a field laborer, he shall pay him eight gur of
corn per year.
-- 1780 BC, Hammurabi, Code of Law
--
Asperger Syndroom - een persoonlijke benadering:
http://people.nl.linux.org/~gerrit/
Het zijn tijden om je zelf met politiek te bemoeien:
http://www.sp.nl/