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

Re: [pygame] shapes other than rects?




> Maybe you could use a few smaller rects to
> approximate the shape you have?
> Instead of having one big rect that contains the
> whole weird shape, have a
> few smaller ones that contain it too. So, for a
> shape like this:
> 
>     ***
>     ***
>     *********
>     *********
> 
> you would *not* have a rect like this:
> 
>    +--------+
>    |        |
>    |        |
>    +--------+
> 
> but intstead a large one as normal that contains the
> blittable shape,
> but two smaller ones for the collision detection:
> 
>    +-+
>    | | 
>    +-+------+
>    +--------+
> 
> This would make the collision detection a two-step
> process, but as you
> still use rects it should be quite fast. This has
> not been tested
> though...

I know a few people who use this technique with
Director/Shockwave games, and even pixel-accurate
collision using lists in text members (!) since
director sprite collisions only happen after the
sprites have already overlapped onscreen and are
therefore pretty useless. 


__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices. 
http://auctions.yahoo.com/
____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org