multilayer maps

14 views
Skip to first unread message

bitcraft

unread,
Sep 27, 2011, 4:41:43 PM9/27/11
to Gummworld2
how are multilayer maps handled? i looked around, but couldn't find
much.

Gummbum

unread,
Sep 27, 2011, 11:45:01 PM9/27/11
to Gummworld2
Howdy, bitcraft.

The Map class has a layers attribute. It's just a list that holds
instances of MapLayer. The Camera class serves the visible layers of
tiles from the map object, in list order. So like...

1. Create a Map object.
2. Create a MapLayer object.
3. Add tiles to the map layer.
4. Append the map layer to map.layers.
5. Repeat steps 2-4 for each additional layer.
6. Work the camera and get the layers to render.

There are helper functions in the toolkit module for loading tiles
from Tiled Map Editor, which supports layers.

Hope that gives you a good foundation to try something or ask deeper
questions. Just let me know how I can help.

Gumm
Reply all
Reply to author
Forward
0 new messages