0
我想洗牌图像表,我也想存储这些图像的坐标,我该怎么做?有没有其他方法可以做到这一点?我所做的是这样的在表格中洗牌图像
local alpha = {{"alpha_a"} , {"alpha_b"} , {"alpha_c"} , {"alpha_d"} ,
{"alpha_e"} , {"alpha_f"} , {"alpha_g"} , {"alpha_h"}}
local coordinates ={{x=092, y=470}, {x=197, y=470}, {x=302, y=470},
{x=407, y=470}, {x=512, y=470}, {x=617, y=470} }
for i=1, #alpha do
local selection = table.remove(coordinates, math.random(#coordinates))
print(selection.x,selection.y, #coordinates)
images = display.newImage(alpha[i][1]..".png")
images.x = selection.x
images.y = selection.y
images:addEventListener("touch",swapping)
end