set display mode 1680,1050,32
sync on : sync rate 60
D3D_init 4 `rem out if you don't have cloggys 3d stuff
autocam off
dim aax#(1446)
dim bby#(1446)
de#=0.0
delay=0
ink rgb(0,100,0)
for y=0 to 1049 step 20
for f=0 to 1679 step 20
box y,f,y+1080,f+1
box f,y,f+1,y+1080
next f
next y
ink rgb(222,222,222)
```````````````````````````````````
loop1:
x#=840+400*sin(de#)
y#=525+400*cos(de#)
ink rgb(170,180,180)
box x#-1,y#,x#+1,y#+1
box x#,y#-1,x#+1,y#+2
ink rgb(222,222,222)
box x#,y#,x#+1,y#+1
inc de#,0.25
inc delay
aax#(delay)=x#
bby#(delay)=y#
if de#<361.0 then goto loop1
print delay
sync
sync
`wait key
`````````````````````````````````````
ink rgb(0,122,0)
box 0,521,1680,522
box 839,0,841,1050
SET GLOBAL COLLISION OFF
cls
ink rgb(0,222,222)
dim a1#(42)
dim af#(42)
dim mf#(42)
dim c(42)
dim rot#(42)
c(0)=rgb(0,0,255)
c(1)=rgb(255,255,0)
t=5
g#=1440.0/t
y#=650.0
for f=0 to t-1
a1#(f)=y#
af#(f)=15.0
y#=y#+20.0
make object sphere f+10,60,16,8
make object cylinder f+20,1
fix object pivot f+20
scale object f+20,39000,100,100
make object cylinder f+30,1
rotate object f+30,0,0,90
fix object pivot f+30
scale object f+30,29000,100,100
position object f+30,0,0,0
hide object f+30
hide object f+20
next f
a1#(0)=190.0
af#(0)=12.0
color backdrop 0
position camera 0,0,0
point camera 0,0,0
set ambient light 65
`position object 1,0,0,800
set camera fov 50
mub=19
`````````````````````````````````````
do
cxx#=900*sin(delay*0.2)
cyy#=200+900*cos(delay*0.1)
position camera cxx#,-150,cyy#
point camera 0,-150,0
`cls
hh=0
rz#=0.0
for f=0 to t-1
ink c(f)
a=a1#(f)
aa=aax#(a)
bb=bby#(a)
bb#=bb-525
aa#=840-aa
position object f+10,aa#*1.7,75+bb#*0.5,0
z2#=-15
z1#=0
x1#=aa#*1.7
y1#=105+bb#*0.5
x2#=(f*55)-156
y2#=305.0
gosub line3d `rem out if you don't have cloggys 3d stuff
position object f+20,x1#,y1#,0
z2#=15
z1#=0
gosub line3d
if rot#(f)>0 then rot#(f)=rot#(f)*0.975
tp=f
inc rot#(f),5
if a1#(f)<720.0
if af#(f)<25.0 then af#(f)=af#(f)*1.01
else
if af#(f)>5.0 then af#(f)=af#(f)*0.99
endif
`gradual energy loss
if af#(f)<15.0 and a1#(f)<720.0 then af#(f)=af#(f)*1.001:if af#(f)>15.0 then af#(f)=15.0
if af#(f)>15.0 and a1#(f)>720.0 then af#(f)=af#(f)*0.999:if af#(f)<15.0 then af#(f)=15.0
b#=af#(f)-15.0
rz#=rz#+(b#*2)
a#=a1#(f)
a1#(f)=a1#(f)+b#
````````````````````````````````````````````````
```proximity collision
u=f+1:if u>t-1 then u=0
if abs(a1#(f)-a1#(u))<mub
a1#(f)=a#
if b#<4.0 then af#(f)=15.0
z#=af#(u):af#(u)=af#(f):af#(f)=z# `transfer movement to then one hit
endif
```proximity collision
u=f-1:if u<0 then u=t-1
if abs(a1#(u)-a1#(f))<mub
a1#(f)=a#
if b#>4.0 then af#(f)=15.0
z#=af#(u):af#(u)=af#(f):af#(f)=z# `transfer movement to then one hit
endif
zrotate object f+10,rz#
if a1#(f)<0.0 then a1#(f)=a1#(f)+1440.0
if a1#(f)>1439.0 then a1#(f)=a1#(f)-1439.0
next f
inc delay
ink rgb(0,200,0)
text 20,620,str$(a1#(0))
sync
loop
`````````````````````````````````````````
Line3D:
LineColor=D3D_RGBA(75,75,200,255)
D3D_Line3D 0,x1#,y1#,z1#,x2#,y2#,z2#,LineColor,LineColor, 0
return