xpenguins cont'd - repainting a window after penguins walk on it, and when penguins overlap.

Amy C mathematical.coffee at gmail.com
Mon Jun 6 16:29:09 PDT 2011

Thanks all for your suggestions, they're much appreciated!

I'm going to try the collision detection as an exercise since it seems
like a classic problem and I have an easy case (2D rectangles).

I'll also look into the SHAPE extension and have a tinker.

Pat - the Grug books by Ted Prior were some of my favourites when I
was little (still are!) :)

I'll check back with the xorg list once I've made a bit of
progress/gotten stuck.


On 07/06/11 00:10, Peter Harris wrote:
> Create one window per penguin, using the SHAPE extension. The server
> will handle this (and most of the rest of the things you mention above)
> so you don't have to.

On 07/06/11 03:47, Corbin Simpson wrote:
> Alan's answer is great for your case. If you're feeling adventurous,
> you could create a spatial dictionary -- an associative array which
> stores all of the penguins by coordinates, using buckets which
> correspond to spatial areas. This massively reduces collision checking
> time for one-against-many, especially when you have lots of sprites to
> check. It might be overkill here, unless you're planning on making
> thousands of penguins. :3
> ~ C.

More information about the xorg mailing list