PyGame QIX clone, filling areas

Posted by astropanic on Game Development See other posts from Game Development or by astropanic
Published on 2012-04-15T08:36:19Z Indexed on 2012/04/15 11:49 UTC
Read the original article Hit count: 376

Filed under:
|

I'm playing around with PyGame.

Now I'm trying to implement a QIX clone.

I have my game loop, and I can move the player (cursor) on the screen.

In QIX, the movment of the player leaves a trace (tail) on the screen, creating a polyline.

If the polyline with the screen boundaries creates a polygon, the area is filled.

How I can accomplish this behaviour ?

How store the tail in memory ?

How to detect when it build a closed shape that should be filled ?

I don't need an exact working solution, some pointers, algo names would be cool.

© Game Development or respective owner

Related posts about algorithm

Related posts about pygame