This repository has been archived by the owner on Jun 4, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* changed exec command to have a "ignoremissing" argument after the …
…script name (broken) * renamed /scripts to /spawn * removed spawn* commands from gravit.cfg * changed recordingvideorefreshtime to 100 git-svn-id: svn://gakman.com/gravit/trunk@258 60970b36-f649-e149-802f-859a9d0a703e
- Loading branch information
gak
committed
May 28, 2005
1 parent
9eb7420
commit addf0ec
Showing
19 changed files
with
171 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
|
||
require("scripts/functions.lua") | ||
|
||
function spawn() | ||
|
||
dist = randomfloat(1,3) * spawnparticles | ||
vel = randomfloat(20,50) | ||
mass1min = randomfloat(500,1000) | ||
mass1max = randomfloat(500,1000) | ||
mass2min = randomfloat(500,1000) | ||
mass2max = randomfloat(500,1000) | ||
ballsize1 = randomfloat(500,1000) | ||
ballsize2 = randomfloat(500,1000) | ||
|
||
makeball(v(0,dist,0), v(-vel,0,0), ballsize1, 0, spawnparticles/2, mass1min, mass1max) | ||
makeball(v(0,-dist,0), v(vel,0,0), ballsize2, spawnparticles/2, spawnparticles/2, mass2min, mass2max) | ||
|
||
end |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
scripts = { "one-galaxy", "binary-galaxy", "many-galaxy", "snake", "loops" } | ||
n = table.getn(scripts) | ||
r = math.random(1,n) | ||
log("Spawining " .. scripts[r]) | ||
spawn = nil | ||
require ("scripts/" .. scripts[r] .. ".lua") | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
|
||
require("scripts/functions.lua") | ||
|
||
function spawn() | ||
|
||
curveness1 = randomfloat(0, 0.1) | ||
curveness2 = randomfloat(0, 0.1) | ||
|
||
curvechangelimit = 0.0001 | ||
|
||
if (randomint(0,4) == 0) then | ||
curvechange1 = randomfloat(-curvechangelimit,curvechangelimit) | ||
else | ||
curvechange1 = 0 | ||
end | ||
|
||
if (randomint(0,4) == 0) then | ||
curvechange2 = randomfloat(-curvechangelimit,curvechangelimit) | ||
else | ||
curvechange2 = 0 | ||
end | ||
|
||
speed = randomfloat(0,5) | ||
if (randomint(0,1) == 0) then | ||
massincrement = randomfloat(-0.01,0.01) | ||
else | ||
massincrement = 0 | ||
end | ||
|
||
massrandom = randomfloat(0,100) | ||
distance = randomfloat(0.1, 5) | ||
|
||
pos = v(0,0,0) | ||
vel = v(0,0,0) | ||
ang1 = 0 | ||
ang2 = 0 | ||
|
||
for i=0,spawnparticles-1 do | ||
|
||
pos.x = pos.x + math.cos(ang1) * distance | ||
pos.y = pos.y + math.sin(ang1) * distance | ||
pos.y = pos.y + math.cos(ang2) * distance | ||
pos.z = pos.z + math.sin(ang2) * distance | ||
|
||
vel.x = math.cos(ang1) * speed | ||
vel.y = math.sin(ang1) * speed | ||
vel.y = math.cos(ang2) * speed | ||
vel.z = math.sin(ang2) * speed | ||
|
||
ang1 = ang1 + curveness1 | ||
ang2 = ang2 + curveness2 | ||
|
||
curveness1 = curveness1 + curvechange1 | ||
curveness2 = curveness2 + curvechange2 | ||
|
||
particle(i, pos, vel, randomfloat(0,massrandom) + massincrement * i) | ||
|
||
end | ||
|
||
end | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
require("scripts/functions.lua") | ||
|
||
function spawn() | ||
-- work out a number of galaxies based on spawnparticles | ||
galaxysize = randomint(10,1000) | ||
galaxies = math.floor(spawnparticles / galaxysize) + 1 | ||
for i=0,galaxies-1 do | ||
makeball(randomrange(galaxies * 2000), randomrange(50), randomfloat(1, 1000), spawnparticles/galaxies*i, spawnparticles/(galaxies), randomfloat(0,1000), randomfloat(0,1000)) | ||
end | ||
end | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
require("scripts/functions.lua") | ||
|
||
function spawn() | ||
particlemassmin = randomfloat(1,1000) | ||
particlemassmax = randomfloat(1,1000) | ||
estmass = (particlemassmin + particlemassmax) / 2 * spawnparticles | ||
galaxyradius = randomfloat(10,1000) | ||
speedbase = randomfloat(0,.0001) | ||
speedbase = .0000001 | ||
for i=0,spawnparticles-1 do | ||
radius = randomfloat(0,galaxyradius) | ||
speed = speedbase * radius * math.sqrt(estmass) | ||
angle = randomfloat(0,2*math.pi) | ||
pos = v(math.cos(angle)*radius, math.sin(angle)*radius, randomfloat(-1,1)) | ||
vel = v(math.cos(angle+math.pi/2)*speed*radius, math.sin(angle+math.pi/2)*speed*radius, 0) | ||
mass = randomfloat(particlemassmin,particlemassmax) | ||
particle(i, pos, vel, mass) | ||
end | ||
end | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
|
||
require("scripts/functions.lua") | ||
|
||
function spawn() | ||
|
||
curveness = randomfloat(0, 0.5) | ||
speed = randomfloat(0,1) | ||
if (randomint(0,1) == 0) then | ||
massincrement = randomfloat(-0.01,0.01) | ||
else | ||
massincrement = 0 | ||
end | ||
|
||
massrandom = randomfloat(0,100) | ||
|
||
pos = v(0,0,0) | ||
vel = v(0,0,0) | ||
ang1 = 0 | ||
ang2 = 0 | ||
|
||
for i=0,spawnparticles-1 do | ||
|
||
pos.x = pos.x + math.cos(ang1) | ||
pos.y = pos.y + math.sin(ang1) | ||
pos.y = pos.y + math.cos(ang2) | ||
pos.z = pos.z + math.sin(ang2) | ||
|
||
vel.x = math.cos(ang1) * speed | ||
vel.y = math.sin(ang1) * speed | ||
vel.y = math.cos(ang2) * speed | ||
vel.z = math.sin(ang2) * speed | ||
|
||
ang1 = ang1 + randomfloat(-curveness,curveness) | ||
ang2 = ang2 + randomfloat(-curveness,curveness) | ||
|
||
particle(i, pos, vel, randomfloat(0,massrandom) + massincrement * i) | ||
|
||
end | ||
|
||
end | ||
|