TinyCircuits / TinyCircuits-Tiny-Game-Engine

MicroPython game engine for TinyCircuits Thumby Color
GNU General Public License v3.0
9 stars 1 forks source link

Add more draw layers and change set/get to just .layer #59

Closed TinyCircuits closed 2 months ago

TinyCircuits commented 2 months ago

First, more draw layers are needed in general as 8 is very little (a game like solitaire is hard to make since the cards stack and there are not enough layers to occlude everything). This will be implemented by increasing the number of layers to something like 64 or 128. Layers are implemented in a static array of linked lists where each linked list is 11 bytes. Therefore, 11 * 128 = 1408 bytes for all the layers. Also, the engine will loop through all these layers to see if anything needs to be rendered, every tick,

Also, instead of .set_layer() and .get_layer() on each node, a layer attribute will be exposed that will change API usage like my_node.set_layer(my_node.get_layer() + 1) to my_node.layer += 1.