Rem Project: Asteroids
Rem Created: 13/02/2006 5:33:58 PM
 
Rem ***** Main Source File *****
sync on:sync rate 30
hide mouse
randomize timer()
autocam off
 
ode start
ode set world gravity 1,0,1
ode set world step 0.05
ode set world erp (0.2)
ode set world cfm (10^-5)
 
field()
wall()
objects()
camera()
 
 
do
color backdrop 0,rgb(0,0,0)
ode update
sync
loop
 
 
function field()
`create object space
make object plain 10,100,100
`position object space
position object 10,0,-20,0
xrotate object 10,90
`colour object
color object 10,rgb(255,0,0)
ode create static box 10
endfunction
 
function wall()
`create walls
make object box 41,110,50,10
make object box 42,110,50,10
make object box 43,110,50,10
make object box 44,110,50,10
`position walls
position object 41,50,-10,0
yrotate object 41,90
position object 42,-50,-10,0
yrotate object 42,90
position object 43,0,-10,50
yrotate object 43,90
turn object left 43,90
position object 44,0,-10,-50
yrotate object 44,90
turn object left 44,90
`colour walls
color object 41,rgb(0,255,0)
color object 42,rgb(0,128,255)
color object 43,rgb(255,0,255)
color object 44,rgb(255,255,0)
`transperent
ode create static box 41
ode create static box 42
ode create static box 43
ode create static box 44
endfunction
 
function objects()
`make player ship
make object cone 1,2
`position player ship
position object 1,0,-10,-40
ode create dynamic triangle mesh 1
`make asteroids
make object box 2,2,2,2
make object box 3,2,2,2
make object box 4,2,2,2
make object box 5,2,2,2
make object box 6,2,2,2
`position asteroids
position object 2,12,-10,12
position object 3,20,-10,40
position object 4,30,-10,-10
position object 5,5,-10,23
position object 6,43,-10,38
`ode asteroids
ode create dynamic box 2
ode create dynamic box 3
ode create dynamic box 4
ode create dynamic box 5
ode create dynamic box 6
`set ode friction
ode set contact fdir1 1, 20.0
ode set contact fdir1 2, 20.0
ode set contact fdir1 3, 20.0
ode set contact fdir1 4, 20.0
ode set contact fdir1 5, 20.0
ode set contact fdir1 6, 20.0
`color objects
color object 1,rgb(255,124,123)
endfunction
 
function camera()
`position camera
position camera 0,0,100,0
point camera 0,0,-100,0
endfunction