After experimenting with scrolling tile maps and deciding that I
couldn't meet my requirements with straight Python, I wrote a C
extension to create a vertex array based on numpy tileMap and texCoord
arrays.

it supports flipping, rotating and tinting (with alpha) individual
tiles and I get about 600fps while scrolling under Linux (8600 GT
video).

The source code is available at:

http://www.koltois.com/2011/12/09/tilemap-test-source-code/

My requirements included unlimited map size, animated tiles, on-the-
fly tinting, etc. and I couldn't get it to work at a decent speed with
Python or even Cython. The rest of the project I am working on is all
Python with Pyglet.

The way it's done also easily supports animated tiles (change the
tileMap ID in the array), but the above code does not implement it.

This code was hacked out of a larger project and is a bit messy and
probably not optimal, but I'm definitely open to suggestions for
improvements.

-- 
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=en.

Reply via email to