We are going to make a change to how a Sprite works - when you do not run it, we will show a random frame.
ZIM Sprite() currently stops on the first frame if you just make a Sprite and add it to the stage (not running it). Most would then run() the sprite with a time parameter. There is also a frame parameter of run() that lets you choose a frame to go to and stop on which is handy for a Texture Atlas approach when the sprite contains images of different items.
Here is the code to just stop on a random frame which is quite useful for a Texture Atlas approach.
new Sprite("ai_trees02.png", 5, 4)
.run({frame:rand(5*4-1)})
.center();
// or use the frame property but then you need to come out of chaining
This is a bit complicated - especially for kids. We added in this functionality by default when we emit a Sprite in an Emitter. We were considering adding it in when we Tile() the Sprite - otherwise, we have to tile it then loop through the tile and run the random frame for each element. Note, we use the frame parameter of run() because the frame parameter of Sprite() refers to the ZIM Frame the Sprite is in.
Then we thought... why not just show a random frame if you do not run() the Sprite. As soon as you run() it would start at 0 by default. So the change is only if you do not run the sprite, it will start at a random frame.
I can't really imagine a time when you would make a Sprite and want it to just show the first frame. Maybe if you were waiting to run the animation but then you would do a run({wait:3}) or something like that. I suppose there might be a time when you do not run it, then interact to run it. In the new scenario, you would then need to run({frame:0}); and it would stay paused on the first frame.
We would be quite happy just announcing the change if it were a new version of ZIM but we want to do it now in ZIM 017 as we we are launching a new section of ZIM Kids that make extensive use of the new texture atlas Sprites.
We are announcing this here as a potential breaking change. Sorry it is a little late after the launch of 017 but we have not officially called 017 stable (just done adding new things). So we are about to make the patch and set it live - will let you know when it is done.