TGC Codebase Backup



Insane Sphere Swarm by MonoCoder

28th Jan 2006 7:10
Summary

Weird load of spheres flying around one another.



Description

Started out as an orbiting planets idea, but became some huge multi-object monster. Strange, could use it for... flies swarming around dead bodies or something.



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    Sync on
Sync rate 0

Set camera range 0.1,60000

For n=1 to 100
Make object sphere n,n
Rotate object n,0,rnd(359),0
Next n

cammove#=0.5

Do

For n=2 to 100
Position object n,object position x(n-1),object position y(n-1),object position z(n-1)
a#=n
a#=a#/50
Rotate object n,wrapvalue(object angle x(n)+(a#/2)),wrapvalue(object angle y(n)+a#),wrapvalue(object angle z(n)+(a#/10))
Move object n,object size(n-1)*40
Next n

If cammove#>-100000 then cammove#=cammove#-0.001
Move camera cammove#
Rotate camera curveangle(30,camera angle x(),100),0,0

Sync
Loop