借助下面编写的代码在屏幕上创建随机对象。我想给这些随机对象命名并在用户点击特定对象时访问它,我实际上是在用户点击特定对象时创建游戏,然后只有该特定对象必须射击。请给点建议谢谢...
imageHolder = {}
numOfImages = 10
for i=1,numOfImages do
imageHolder[i] = display.newImageRect("myImage.png", 20, 20)
imageHolder[i].name="images"
imageHolder[i].x = math.random(0, display.contentWidth)
imageHolder[i].y = math.random(0, display.contentHeight)
end