This didnt come to my mind earlier, but now that it came i wonder do i need to alter code.
Thing is, i have missions in my game.
Each mission uses same page and it just sends string mission to know which mission.bin to know ie "mission"..mission..".bin" could be mission1.bin if mission=1 which is determined in previous page on mission player chooses.
Now since i was making the engine basically all the way to this point, it never occured to me that there might come pronblem from table creation.
for thing is, in this mission page, it creates several tables in way of:
Code: Select all
enemy={}
snowball={}
But in game in practice, you play mission, finish it, choose new mission and it goes to that same mission page again.
And this i now wonder if what happend when same table is created again.
For now for example that enemy={} is done when you first time go to first mission. Along the mission there will come lots of stuff to that enemy like enemy[wave][group][id].x
So theres coming plenty of stuff to that table.
When mission ends, theres no worry yet, but when you go to second mission and it starts next mission, then what happens at part when comes the line:
Code: Select all
enemy={}
Does it ignore that command? Does it create whole new table and destroy all the old stuff away, that if size of enemy table was say, enemy[5][10][3] its size would now be only one empty table and all those old stuff are gone?
As far as i tested with designer, it at least on my short test didnt give me any trouble, but i just wonder if there is some bomb laying there waiting for me.
Say i decide to check next free enemy and go through it with command RawGet(), then it gives me result of next free being enemy[5][10][4] when real answer would be enemy[0]?
For basically i can do those table creation parts elsewhere or add table destroyers or something to end of level code, but it would just be quite much work to do that all at this point, plus it would make harder testing engine part separately.