*** Title supposed to be ’ Except certain positions’ and not ’ Accept’ *** sorry for that mistake
I’m wondering if its possible to have a table of coordinates and inside a spawn function that creates a display object, make it exclude those positions inside the table when positioning.
For example, I have another object that is spawning at these coordinates only…
local yPosition = {100, 160, 220 }
And using them like this when creating an object.
local rnd = math.floor(math.random() \* 3) +1 if(rnd == 0) then gem2 = display.newImageRect("images/obstacle1.png", 90,212) gem2.x = display.contentWidth + 100 gem2.y = yPosition[math.floor(math.random() \* 4)+1]
Is there a way to use something similar to that, but only exclude the positions in yPosition and spawn everywhere else?
Hope this made sense.
Cheers.