File: binary-galaxy.gravitspawn

package info (click to toggle)
gravit 0.5.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 10,420 kB
  • ctags: 942
  • sloc: ansic: 6,841; makefile: 63; sh: 43
file content (23 lines) | stat: -rw-r--r-- 746 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
-- vim:syntax=lua tabstop=4

load("functions.lua")

function describe()
    log("Two galaxies rotating around each other")
end

function spawn()

	local dist = randomfloat(1,3) * spawnparticles
	local vel = randomfloat(20,50)
	local mass1min = randomfloat(500,1000)
	local mass1max = randomfloat(500,1000)
	local mass2min = randomfloat(500,1000)
	local mass2max = randomfloat(500,1000)
	local ballsize1 = randomfloat(500,1000)
	local ballsize2 = randomfloat(500,1000)

	makegalaxy(v(0,dist,0), v(-vel,0,0), ballsize1, mass1min, mass1max, 0, math.floor(spawnparticles/2))
	makegalaxy(v(0,-dist,0), v(vel,0,0), ballsize2, mass2min, mass2max, math.floor(spawnparticles/2), spawnparticles - math.floor(spawnparticles/2))
	
end