Hi i dont have a good programming structure, im trying to learn lua as i try stuff and read documents and tutorials.
I’ve managed to make something, but i have a lot of redundant code. Thats not really the problem since im not trying to master my programming skill for my first game, but i usually get stuck on some parts. Actually im stuck in something related to objects position on the screen. I wont post the entire code because it has more than 1000 lines (like i said, very primitive and redundant but its ok for me) but i can reproduce it:
I have 3 groups (im not talking about the display.newGroups, im using tables) of objets, each of them has 3 images, and im using 3 differents buttons to render each of the group images. For example:
group01 = head,ear,nose
group02 = hand,chest,arm
group03 = leg, foot, shoes
Every time i press group01_button, it renders head, the next time ear, etc (using tables), same for 02 and 03.
How do i do to show group01’s objets allways above group02 and group03? I know about toFront and toBack functions, but i have a lot of groups (and other stuff like background and maybe particles) and it’d be a mess.
Some advice? How’d you do it?
Thanks in advance! [import]uid: 108461 topic_id: 23627 reply_id: 323627[/import]
[import]uid: 80100 topic_id: 23627 reply_id: 94821[/import]