Using corona 1251, tested too in 1234. I can’t test my app in corona simulator…because i am using maps, it happens to me in Ios simulator
local function roulette(event ) for i=1,#pointers do pointers[i].alpha=0 pointers[i].target=0 end math.randomseed( os.time()\*randomInc ) local seed=math.random(#pointers) pointers[seed].alpha=1 pointers[seed].target=1 end
randomInc is in a loop and increment its value …i added because with os.time didnt work…
values of os.time()*randomInc=423321093702,435771714420,448222334832…and so
seed value is always=1
EDIT:
the function roulette is called by a timer:
if the timer has a value of 1500 it works…
with 1000 the sequence of see var is:12345,12345,12345
300 always seed=1
Why is this? I need to understand it…
EDIT2
I am calling the roulette function inside a loop instead a timer and the result is the same ,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5… i really dont understand it… #pointers always has 5 elements created in createScene
EDIT3
removing “math.randomseed( os.time() )”
make it works …i thought it was better to add it