Hello-
I’m making a game in which one basic tiled map is re-used for the entire game but the scene has to reset to a default state before each turn. I am using the suggested Composer layout to transition between game states with a removeScene(“scene”) to kill the previous turn and gotoScene(“scene”) to start again. For some reason I am only able to run the game twice before seeing a blank screen. In my console window, I see this:
Jan 1 20:50:48 MacBook.local Corona Simulator[30615]: World Size X: 1000
Jan 1 20:50:48 MacBook.local Corona Simulator[30615]: World Size Y: 30
Jan 1 20:50:48 MacBook.local Corona Simulator[30615]: Levels: 1
Jan 1 20:50:48 MacBook.local Corona Simulator[30615]: Reference Layer: 1
Jan 1 20:50:48 MacBook.local Corona Simulator[30615]: WARNING(detectSpriteLayers): No Sprite Layers Found. Defaulting to all map layers.
Jan 1 20:50:48 MacBook.local Corona Simulator[30615]: Map Load Time(ms): 182.5
Jan 1 20:50:55 MacBook.local Corona Simulator[30615]: BALL VELOCITY IS ZERO
Jan 1 20:51:00 — last message repeated 136 times —
Jan 1 20:51:00 MacBook.local Corona Simulator[30615]: you are pressing the button to try again
Jan 1 20:51:00 MacBook.local Corona Simulator[30615]: World Size X: 1000
Jan 1 20:51:00 MacBook.local Corona Simulator[30615]: World Size Y: 30
Jan 1 20:51:00 MacBook.local Corona Simulator[30615]: Levels: 2
Jan 1 20:51:00 MacBook.local Corona Simulator[30615]: Reference Layer: 1
Jan 1 20:51:00 MacBook.local Corona Simulator[30615]: Map Load Time(ms): 3.0579999999991
Jan 1 20:51:09 MacBook.local Corona Simulator[30615]: BALL VELOCITY IS ZERO
The bolded sections are what confuse me. Why do the levels change to 2 on the 2nd loading of the same map and why does the map not detect a sprite layer only on the first throw? This makes me think the error is related to the tiled map itself even though it DOES contain an object/sprite layer and a tiled layer…
Another interesting thing is that when mte.debug() is running, the FPS for the first throw will be ~30 but for the second throw, above 1000. This makes me think that the prior map/debug session isn’t being removed from the prior turn. I do use mte.cleanup() in the scene:destroy() function.
Any suggestions?