Sure thing.
local mRand = math.random local function moveB1() math.randomseed( os.time() ) split2.degree1 = mRand(1,360) split2.xSpeed1 = math.cos(degree\*math.pi/180) split2.ySpeed1 = math.sin(degree\*math.pi/180) bubbleS1:setLinearVelocity(split2.xSpeed1\*impulseVal, split2.ySpeed1\*impulseVal) end local function moveB2() math.randomseed( os.time()\*42/13 ) split2.degree2 = mRand(1,360) split2.xSpeed2 = math.cos(degree\*math.pi/180) split2.ySpeed2 = math.sin(degree\*math.pi/180) bubbleS2:setLinearVelocity(split2.xSpeed2\*impulseVal, split2.ySpeed2\*impulseVal) end local function moreButtonCountSplit() if split2.timerLoop == 40 then -- give a force to both objects moveB1() moveB2() end end
That is the part I am currently working on.
However during the game whenever either object touches a wall it respectively receives a linear velocity. This means I simply cannot have both random numbers being generated in the same function.