Hi there,
I am writing a game that will have a number of clouds floating across the screen colliding with other objects. And I just wanted which of the two methods below is better for inserting the images into a group?
[code]
local gameLayer = newGroup()
Use a table
local clouds {
cloud1 = display.newImage(‘images/cloud.png’),
cloud2 = display.newImage(‘images/cloud.png’),
cloud3 = display.newImage(‘images/cloud.png’)
}
gameLayer.insert(clouds)
or is it better to insert each image individually
local gameLayer = newGroup()
local cloud1 = display.newImage(‘images/cloud.png’)
local cloud2 = display.newImage(‘images/cloud.png’)
local cloud3 = display.newImage(‘images/cloud.png’)
gameLayer:insert(cloud1)
gameLayer:insert(cloud2)
gameLayer:insert(cloud3)
[/code] [import]uid: 167310 topic_id: 30525 reply_id: 330525[/import]