I have a function that spawns a variety of different bicycles that zip across the screen left to right. My function works fine, but the problem is: these bicycles are animations, each with their own sequence of images, and need to be told to play. The way things are now, only their first frame shows as they zip across the screen. Here’s the code for my function:
local images = {} images[#images + 1] = 'Green Bicycle'images[#images + 1] = 'Red Bicycle'images[#images + 1] = 'Blue Bicycle'images[#images + 1] = 'Yellow Bicycle'images[#images + 1] = 'Orange Bicycle'images[#images + 1] = 'Purple Bicycle'local function bicycleSpawn (event)local index = math.random( 1, #images )timers[#timers + 1] = timer.performWithDelay(math.random(20,35),bicycleSpawn) local bicycle = bicycleFactory:newSpriteGroup( images[index] ) bicycle:addPhysics(physics,'dynamic',{}) bicycle.x = -100 bicycle.y = math.random(80,884) physics.addBody(bicycle,"dynamic",{isSensor = true}) bicycle.isSensor = true transitions[#transitions + 1] = transition.to(bicycle, {time = math.random(1400,1500), delay = 0, x = bicycle.x + 968, onComplete=function() bicycle :removeSelf() end}) spawnedGroup:insert(bicycle)end[/code]As someone new to Corona, I figure I need to add something like:play('Green Bicycle')play('Red Bicycle')--etc...[/code]into my code somewhere, but I don't know where or how to do this. Any hints would be much appreciated, and if please let me know if you need more/clearer information.Thank you,Steven [import]uid: 79394 topic_id: 16168 reply_id: 316168[/import]