i guess here's the whole thing...
REM Project: Schematics of Daedlus
REM Created: 4/17/2010 12:54:38 PM
REM
REM ***** Main Source File *****
REM
Menu:
load image "swirl.bmp",10
make object sphere 600,800,58,58
texture object 600,10
`scale object texture 600,4,4
set object cull 600,0
position camera 0, 40, -170
load image "newgamenormal1.png",1
load image "newgameglow1.png",2
load image "controlsnormal.png",3
load image "controlsglow.png",4
ButtonX = 220
ButtonY = 100
sprite 1,ButtonX,ButtonY,1 : `New Game
ButtonX1 = 220
ButtonY1 = 226
sprite 2,ButtonX1,ButtonY1,3 : `Controls
do
if mouseX() > 220 and mouseX() < 420 and MouseY() > 120 and MouseY() < 180
if mouseclick()=1
clearworld()
GOTO level1
endif
Glow = 1
else
Glow = 0
endif
if Glow = 0 then sprite 1,ButtonX,ButtonY,1
if Glow = 1 then sprite 1,ButtonX,ButtonY,2
if mouseX() > 240 and mouseX() < 410 and MouseY() > 246 and MouseY() < 286
if mouseclick()=1
clearworld()
goto level2
endif
Glow = 2
else
Glow = 3
endif
if Glow = 3 then sprite 2,ButtonX1,ButtonY1,3
if Glow = 2 then sprite 2,ButtonX1,ButtonY1,4
rotate object 600, object angle x ( 600 ) + 0.035, object angle y( 600 ), object angle z ( 600 ) + 0.001
loop
Level1:
` set up general properties
sync on
sync rate 60
autocam off
set camera range 0.5, 30000
hide mouse
load image "Level1Question1.bmp",100
load image "Level1Question2.bmp",101
load image "Level1Question3.bmp",102
load image "Level1Question4.bmp",103
` load our skybox
load object "skybox2.x", 2
set object light 2, 0
set object texture 2, 3, 1
scale object 2, 30000, 30000, 30000
`Finish Sign
load object "Finish1.x",11
scale object 11,300,300,300
position object 11,-170,3,364
`Box to end level
make object box 12,40,40,40
position object 12,-144,20,346
hide object 12
sc_setupobject 12,2,1
`load maze
load object "level1.dbo",10
sc_setupobject 10,1,0
` create box controller
make object box 3, 2, 5, 2
position object 3,336,51,-310
sc_setupobject 3,1,0
hide object 3
SignPosts()
obstacles()
`=====================================================================
`=====================================================================
`Variables
gravity# = 1.5
`=====================================================================
`=====================================================================
` our main loop
do
position camera 0,object position x(3),object position y(3)+5,object position z(3)
rotate camera 0,camera angle x(0)+mousemovey()/2.5,object angle y(3),object angle z(3)
if camera angle x(0) >= 85
xrotate camera 0,85
endif
if camera angle x(0) <= -85
xrotate camera 0,-85
endif
` react to key presses and move the controller
oldx# = object position x(3)
oldy# = object position y(3)
oldz# = object position z(3)
position object 3,oldx#,oldy#-gravity#,oldz#
key = 0
if spacekey()
key =1
move object up 3,4.0
endif
if upkey ( )
key = 1
move object 3,1.5
endif
if downkey ( )
key = 1
move object 3, -1.5
endif
if leftkey ( )
key = 1
move object left 3,0.5
endif
if rightkey ( )
key = 1
move object right 3,0.5
endif
if key = 0
move object up 3,0.0
move object 3,0.0
endif
` update the simulation and screen
x# = object position x(3)
y# = object position y(3)
z# = object position z(3)
collide = sc_sphereSlideGroup(1,oldx#,oldy#,oldz#,x#,y#,z#,10,0)
signcollide = sc_sphereSlideGroup(4,oldx#,oldy#,oldz#,x#,y#,z#,10,0)
endcollide = sc_sphereSlideGroup(2,oldx#,oldy#,oldz#,x#,y#,z#,10,0)
if endcollide>0
clearworld()
goto level2
endif
if collide>0
x# = sc_getCollisionSlideX()
y# = sc_getCollisionSlideY()
z# = sc_getCollisionSlideZ()
endif
Questioncollide = sc_sphereCast(20,oldx#,oldy#,oldz#,x#,y#,z#,10,0)
if Questioncollide > 0
sprite 100,0,380,100
endif
if sprite exist(100)
if keystate(30)=1
delete object 20
sc_removeobject 20
delete sprite 100
endif
endif
rotate object 3,object angle x(3),object angle y(3)+mousemovex()/2.5,object angle z(3)
position object 3,x#,y#,z#
print "x",object position x(3)
print "z",object position z(3)
`=====================================================================
`=====================================================================
sync
loop
`================================================================================================
`================================================================================================
`================================================================================================
Level2:
` set up general properties
sync on
sync rate 60
autocam off
set camera range 0.5, 30000
hide mouse
` load our skybox
load object "skybox2.x", 2
set object light 2, 0
set object texture 2, 3, 1
scale object 2, 30000, 30000, 30000
`Finish Sign
load object "start.x",11
scale object 11,700,700,700
yrotate object 11,180
position object 11,40 ,530,-8
`Box to end level
make object box 12,40,40,40
position object 12,-144,20,346
hide object 12
sc_setupobject 12,2,1
`load maze
load object "level2mountain.dbo",10
sc_setupobject 10,2,0
` create box controller
make object box 3, 2, 5, 2
position object 3,20,650,20
sc_setupobject 3,1,0
hide object 3
`Make platforms
Homebase()
Platforms()
`=====================================================================
`=====================================================================
`Variables
CTtimer = timer()
CTVal = 60 : `Seconds
gravity# = 1.0
`=====================================================================
`=====================================================================
` our main loop
do
set cursor 10,390
`Make Clock
if Timer() - CTtimer => 1000
Dec CTVal
CTtimer = Timer()
EndIf
set text size 18 : print "Time Remaining: ";Str$(CTVal)
If CTVal = 0
clearworld()
endif
position camera 0,object position x(3),object position y(3)+5,object position z(3)
rotate camera 0,camera angle x(0)+mousemovey()/2.5,object angle y(3),object angle z(3)
if camera angle x(0) >= 85
xrotate camera 0,85
endif
if camera angle x(0) <= -85
xrotate camera 0,-85
endif
` react to key presses and move the controller
oldx# = object position x(3)
oldy# = object position y(3)
oldz# = object position z(3)
position object 3,oldx#,oldy#-gravity#,oldz#
key = 0
if spacekey()
key =1
move object up 3,5.0
endif
if upkey ( )
key = 1
move object 3,1.0
endif
if downkey ( )
key = 1
move object 3, -1.0
endif
if leftkey ( )
key = 1
move object left 3,0.5
endif
if rightkey ( )
key = 1
move object right 3,0.5
endif
if key = 0
move object up 3,0.0
move object 3,0.0
endif
` update the simulation and screen
x# = object position x(3)
y# = object position y(3)
z# = object position z(3)
endcollide = sc_sphereSlideGroup(2,oldx#,oldy#,oldz#,x#,y#,z#,10,0)
if endcollide>0
end
endif
collide = sc_sphereSlideGroup(1,oldx#,oldy#,oldz#,x#,y#,z#,10,0)
if collide>0
x# = sc_getCollisionSlideX()
y# = sc_getCollisionSlideY()
z# = sc_getCollisionSlideZ()
endif
rotate object 3,object angle x(3),object angle y(3)+mousemovex()/2.5,object angle z(3)
position object 3,x#,y#,z#
print "x",object position x(3)
print "y",object position y(3)
print "z",object position z(3)
sync
loop
`================================================================================================
`================================================================================================
`================================================================================================
`==================================================================
`==================================================================
`==================================================================
`Functions
Function ClearQuestion()
for x = 1 to 300
if sprite exist(x) then delete sprite x
next x
EndFunction
Function Posts(num,xpos,zpos,angle)
load object "signpost.x",num
position object num,xpos,0,zpos
Sc_setupobject num,1,1
yrotate object num,angle
EndFunction
Function SignPosts()
Posts(20,333,-85,0)
Posts(21,205,231,0)
Posts(22,51,187,180)
Posts(23,-145,243,0)
EndFunction
Function Blocks(num,xpos,zpos)
Make object box num,40,60,40
position object num,xpos,30,zpos
sc_setupobject num,0,0
EndFunction
Function Obstacles()
Blocks(30,339,-49)
Blocks(31,207,277)
Blocks(32,49,147)
Blocks(33,-145,276)
EndFunction
Function HomeBase()
load object "box.dbo" ,1
load effect "reflection.fx",1,1
set object effect 1,1
position object 1,20,520,20
sc_setupobject 1, 1,0
sc_allowobjectscaling 1
scale object 1,50,15,50
sc_updateobject 1
EndFunction
`===========================================================
`Set up Boxes
Function Boxes(objnum,xpos,ypos,zpos)
load object "box.dbo" ,objnum
position object objnum,xpos,ypos,zpos
sc_setupobject objnum, 1,0
sc_allowobjectscaling objnum
scale object objnum,40,15,40
sc_updateobject objnum
EndFunction
`===========================================================
`Make Platforms
Function Platforms()
Boxes(20,-85,520,140)`25,520,140
Boxes(21,320,530,230)`120,530,230
Boxes(22,-20,560,300)`40,560,300
Boxes(23,150,540,310)`150,540,310
EndFunction
`===========================================================
`EndLevel
Function EndLevel()
If CTVal = 0 then end
EndFunction
`===========================================================
`ClearWorld
Function Clearworld()
for x = 1 to 1000
if object exist(x) then delete object x
if sound exist(x) then delete sound x
if sprite exist(x) then delete sprite x
next x
EndFunction