-- vim:syntax=lua tabstop=4 load("functions.lua") function describe() log("A few massive particles and a ball of relatively ligher particles with random velocities") end function spawn() local onlyone = randomint(0,1) local massiveparticles local bigrange if (onlyone == 1) then massiveparticles = 1 bigrange = .1 else massiveparticles = randomint(1, 3) bigrange = randomfloat(1, 2) end local smallrange = randomfloat(100, 10000) local bigmass = randomfloat(1000, 100000) local smallmass = randomfloat(100, 1000) local smallmassvaries = randomint(0,1) local initvel = randomfloat(1, 100) for i=0,spawnparticles-1 do if (i < massiveparticles) then pos = randomrange(bigrange) vel = v(0,0,0) mass = bigmass else pos = randomrange(smallrange) vel = randomrange(initvel) if (smallmassvaries == 1) then mass = randomfloat(1,smallmass) else mass = smallmass end end particle(i, pos, vel, mass) end end