I am following this guide:
Trying to create a tiled map that also supports multiple layers. The guide says that a way is to use depth buffer, and says to:
1) Create the z-buffer and a 2D projection; 2) For every layer in the tiled map, set the cc_vertexz attribute; 3) Enable alpha test and set the sprite alpha func.
The first question is: if I use a tiled maps with multiple layers, are also the point 1 and 3 needed?
I am fine with the first two points, but as for the third point I don't know how to do that. I should subclass CCSprite and override the draw method, but the problem is that when I create a tiled map there are already sprites on it, so the instances don't belong to the subclass I created. How I go around this?