class Spawner { PVector hotspot; PVector center; PVector wind; Palette pal; float spread; float radius; float scalar; Spawner( float spacing, float crawlerRadius, float stepSize ) { spread = spacing; radius = crawlerRadius; scalar = stepSize; hotspot = new PVector( random(-1,1), random(-1,1), random(-1,1) ); center = new PVector( random(-100,100), random(-100,100), random(-100,100) ); wind = PVector.sub( center, hotspot); wind.normalize(); pal = new Palette( PALETTES[(int)random( PALETTES.length )] ); } Crawler Spawn() { PVector pos = new PVector( random( -spread, spread), random( -spread, spread ), random( -spread, spread )); PVector vel = PVector.add( wind, new PVector( random( -1.2, 1.2), random( -1.2, 1.2 ), random( -1.2, 1.2 )) ); vel.mult( scalar ); return new Crawler( pos.get(), vel.get(), radius, pal.GetColor() ); } }