Hi all! I’m trying to shuffle a table with a x and y values and put these values in 9 images. I put the images in a storyboard template scene…
But the x and y values repeat in much case… Is possible only shuffle with storyboard in create scene function?
local storyboard = require( "storyboard" )
local scene = storyboard.newScene()
local jing1, jing2, jing3, jing4, jing5, jing6, jing7, jing8, jing9
local puz = { {x=98,y=207},{x=92,y=367},{x=95,y=564},{x=273,y=763},{x=946,y=584},{x=786,y=708},{x=541,y=708},{x=943,y=207},{x=950,y=418}}
local u = 9
local o
function scene:createScene( event )
local group = self.view
o = math.random(u)
jing1 = display.newImageRect( "images/2.png", 135, 86 )
jing1.x = puz[o].x
jing1.y = puz[o].y
jing1.id = "p1"
..............................
jing2 = display.newImageRect( "images/1.png", 135, 86 )
jing2.x =
jing2.y =
jing2.id = "p2"
more jin3, jing4
...................
Thanks for the help [import]uid: 69841 topic_id: 24859 reply_id: 324859[/import]
