I am attempting to update my tile map code to use the latest image sheets etc for maximum speed increases, and I am getting an interesting crash when using sprites in image groups.
Essentially I create the image sheet, create a single animation that contains all the frames, then create sprites for the entire screen, and use setFrame( index ) to change to the frame.
The fun part is that it works with normal display groups, but if I replace:
tileLayerData.group = display.newGroup() – OLD
with:
tileLayerData.group = display.newImageGroup( self.imageSheet ) – NEW
then the demo starts, displays the first frame, and then the simulator crashes and I get the following output in the message window:
Corona Simulator(1060,0xad1592c0) malloc: *** error for object 0xe46e04: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
/Applications/CoronaSDK/Corona Terminal: line 9: 1060 Abort trap: 6 “$path/Corona Simulator.app/Contents/MacOS/Corona Simulator” $*
[EDIT]
I should point out that I can get the image groups working if I comment out the setFrame() line in the sprites, which gives me an almost dreamy 100% speed up compared to the equivalent code of ye olde sprites (could be more actually, but I don’t have a test level with more than 6 layers of fullscreen parallax, and it was hitting 60fps consistently!) but isn’t a real-world test case as no swapping of frames = every tile in the world is identical
[import]uid: 46639 topic_id: 23275 reply_id: 99404[/import]