The code I have is over 10,000 lines and growing. I plan to clean it up and condense it. Since I plan to eventually sell it I can't give you the entire code but what I did was extract items that show the basic lines what check for collisions. I hope this will be enough. I have been working on the project for over a year now during my free time.
// ========================================
// ==== Check Desktop Screen Size Here ====
// ========================================
Perform Checklist for Display Modes
For C=1 To Checklist Quantity()
Width=Checklist Value A(C)
Height=Checklist Value B(C)
Depth=Checklist Value C(C)
If Width> W2 or Height> H2
W2 = Width
H2 = Height
Endif
Next C
// ==========================================
// ==== Set the Desktop Screen Size Here ====
// ==========================================
Set Display Mode W2,H2,32
// Only use this when started in hidden mode
show window
// enable fullscreen
Set Window On
hide Mouse
Sync On
sync rate 0
Autocam Off
Fastsync 1
// ======================================
// ==== Seed Random Number Generator ====
// ======================================
Randomize Timer()
// ==================================
// ==== Set Constant Values Here ====
// ==================================
#Constant Dice1 11
#Constant Dice2 12
#Constant Finalmsg 8
#Constant Headingmsg 5
#Constant Scoremsg 6
#Constant Tens 4
#Constant Throwmsg 7
#Constant Throwsmadem 9
#Constant Throwtens 11
#Constant Throwunits 10
#Constant Units 3
// =====================================
// ==== Set Null For Collision Here ====
// =====================================
Null = Make Vector3(1)
// ==================================
// ===== Declare Variables Items ====
// ==================================
global Ax# as float, Az# as float, Pspeed# as float
Global Attackval
Global Ay# as Float
Global Camobj
Global Camradius#
Global Current
Global Cx# as Float
Global Cy# as Float
Global Cz# As Float
Global D1
Global D2
Global D3
Global R3
Global Df
Global Df1,Df2,Df3
Global Df10
Global Df4,Df5,DF6
Global Df7,Df8,Df9
Global Dim Lastval(78)
Global Dim Lastwin$(78)
Global Dist# as Float
Global Dpx# as Float
Global Dpy# as Float
Global Dpz# as Float
Global Dx# as Float
Global Dy# as Float
Global Dz# as Float
Global Gravity# as Float
Global Height
Global Hero$ as String
Global Hero1$ as String
Global Img
Global Light
Global Lvl
Global Lx#
Global Ly#
Global Lz#
Global Level
Global Lever1
Global Lives
Global M
Global M1
Global M11,M12,M13,M14,M15,M16
Global M2
Global Maxspells
Global MBack
Global MBack11
Global MBack12
Global Newx# as Float
Global Newy# as Float
Global Newz# as Float
Global Oldx# as Float
Global Oldy# as Float
Global Oldz# as Float
Global Player
Global Pspeed# as Float
Global PO# as Float
Global Px# as Float
Global Py# as Float
Global Pz# as Float
Global Rx# as Float
Global Rz# as Float
Global Radius# as Float
Global Roll
Global Rollvalue
Global S
Global S2
Global Secret
Global Sword
Global Sx# as Float
Global Sy# as Float
Global Sz# As Float
Global T
Global TF
Global T1
Global T11,T12,T13,T14,T15,T16
Global T2
Global Tc1
Global Tc2
Global TCBack
Global TCBack11
Global TCBack12
Global TFlag
Global Dim TFlag(120)
Global Throws as Integer
Global Treasure$ as String
Global Width
Global World
Global X,Y,Z,knt
Global X2,Y2,angle,anglespeed
Global X1
Global X12
Global Xv
Global Y1
Global Ym
Global Yv
Global Z1
Global Z12
Global NumZout
Global NumZin
Global NumXout
Global NumXin
Global HighNum
Global LowNum
Global HighZnum
Global LowZnum
Global Objnum
Global Value
Global Points$ as String
Global iObjectFrame
Global iLastTime
Global iObject, iFrame, iFrameAcross, iFrameDown
Global iXTile,iYTile,fTu#,fTuSeg#,fTv#,fTvSeg#
Global Switch1,Door1,Switch2,Door2,Door3,Door4
Global Switch3,Switch4,Switch5,Switch6
Global RoamNum
Global AnimNum1
Global AnimNum2
Global AnimNum3
Global AniStart
Global AniStop
Global LoseStart
Global LoseStop
Global RFlag
Global Guard
Global RDF
Global loadrange
Global Win
Global RM
Global RTr
Global RmLvl
// =====================================
// ==== Assign Variable Values Here ====
// =====================================
Gravity# = 0.5
Radius# = 21.5
Pspeed# = 1.0
World = 5 // Obj# Of Universe.Dbo
Player = 6 // Obj# Of Player
Camobj = 7 // Obj# Of Camera
Camradius# = 10.0 // Radius# Of Camera
Lives = 3 // Total # Of Lives At Start (May Add To Constant)
TFlag=1
knt=1
Points$ = ""
Mytreasure=0
Lvl=0 // Starting Level
Img = 10 // Set Start # For Card Images Here
Current = 0
// =============================================
// ==== Set Up Misc Arrays Here ====
// =============================================
Dim TFlag(120)
Dim String$(34)
Dim Charx(90)
Dim Lastval(78) as Integer
Dim Lastwin$(78) as String
For J = 1 to 120
TFlag(J) = 1
NEXT
// =====================
// ==== Set Up Dice ====
// =====================
Create Animated Sprite Dice1,"Media\Dice61.Bmp",6,1,5
Clone Sprite Dice1, Dice2
Sprite Dice1,1550,600,5
Sprite Dice2,1650,600,5
Hide Sprite Dice1
Hide Sprite Dice2
// =======================================
// ==== Display Title Background Here ====
// =======================================
Do
Cls
Load Bitmap "Media\Startup.Jpg",0
Load Image "Media\Logo Overlay.Jpg",1
Set Current Bitmap 0
Set Text Size 40
Set Text to Normal
Rgbforevalue=Rgb(255,255,0)
Rgbbackcolor=Rgb(255,255,255)
Ink Rgbforevalue, Rgbbackcolor
Lg1 = Image Width(1)
Lg2 = Image Height(1)
Sprite 1,(W2/Lg2)+Lg1+50,20,1
Set Text Size 32
Set Text to Normal
SET TEXT FONT "Verdana"
Cls
// ==============================
// ==== Start Game Play Here ====
// ==============================
Start:
// ==============
// ==== Doors ====
// ==============
// ===== Load Door #1 Here =======
Load Object "Secret_Wall2.X",31
Load Image "G_Door.Bmp",4
Texture Object 31,4
set Object light 31,05
Position Object 31,1798,543,-1950
Yrotate Object 31,90
Scale Object 31,80,100,80
Set Object Speed 31,14
sc_Setupobject 31,1,2
// ===== Load Door #2 Here =======
Load Object "Secret_Wall2.X",32
sc_Setupobject 32,1,2
Texture Object 32,4
set Object light 32,05
Position Object 32,1950,543,-2102
Scale Object 32,80,100,80
Set Object Speed 32,14
// ===== Load Door #3 Here =======
Load Object "Secret_Wall2.X",33
sc_Setupobject 33,1,2
Texture Object 33,4
set Object light 33,05
Position Object 33,2150,543,-2102
Scale Object 33,80,100,80
Set Object Speed 33,14
// ===== Load Door #4 Here =======
Load Object "Secret_Wall2.X",34
Texture Object 34,4
sc_Setupobject 34,1,2
Position Object 34,2202,543,-1950
set Object light 34,05
Yrotate Object 34,90
Scale Object 34,80,100,80
Set Object Speed 34,14
// ==== Load Sign ======
Make object box 333,200,100,2
Load Image "Sign1.bmp",333
Texture Object 333,333
set Object ambient 333,10
Position Object 333,2050,650,-2095
// ==============================================
// ==== Door Switches for Level 1 ====
// ==============================================
// ======= Door#1 Master Switch =======
Load Object "wlever1.x",400
Load Image "wlever1.bmp",401
scale object 400,100,100,100
Position Object 400,2193,540,-1850
yrotate object 400,90
sc_Setupobject 400,1,2
Set Object Speed 400,10
Set object ambient 400,60
// ======= Door#4 Master Switch =======
Load Object "wlever1.x",402
scale object 402,100,100,100
Position Object 402,1807,540,-1850
yrotate object 402,270
sc_Setupobject 402,1,2
Set Object Speed 402,10
Set object ambient 402,60
// ======= Door#3 Master Switch =======
Load Object "wlever1.x",403
scale object 403,100,100,100
Position Object 403,1807,540,-2050
yrotate object 403,270
sc_Setupobject 403,1,2
Set Object Speed 403,10
Set object ambient 403,60
// ======= Door#2 Master Switch =======
Load Object "wlever1.x",404
scale object 404,100,100,100
Position Object 404,1900,540,-1807
sc_Setupobject 404,1,2
Set Object Speed 404,10
Set object ambient 404,60
// ================================
// ==== Level Release Switches ====
// ================================
// ======= Level 2 Release Switch (on Level 1) =======
Load Object "chainpull1.x",405
Load Image "chainpull1.bmp",402
scale object 405,100,100,100
Position Object 405,2592,545,-2150 // see about random locations
YROTATE OBJECT 405,90
sc_Setupobject 405,1,2
Set Object Speed 405,10
Set object ambient 405,50
// ======= Level 3 Release Switch =======
Load Object "chainpull1.x",406
scale object 406,100,100,100
Position Object 406,891,445,-2260 // see about random locations
YROTATE OBJECT 406,90
sc_Setupobject 406,1,2
Set Object Speed 406,10
Set object ambient 406,80
// =======================
// ====== Wall Signs =====
// =======================
// ==== Load Level 2A Sign ======
Make object box 334,100,100,2
Load Image "Level 2.bmp",335
Texture Object 334,335
set Object light 334,05
Position Object 334,1211,550,-1950
yrotate object 334,90
// ======================================
// ==== Create Torch FLAMES HERE ====
// ======================================
make object plain 700,20,20
load image "animated\torchflame16\torchflame16.png",700
texture object 700,700
set object transparency 700,1
set object light 700, 0
SET OBJECT ambience 700,1
For T = 701 to 899 // sets the number of animated torches
clone object T,700
set object light T, 0
SET OBJECT ambience T,1
Next T
// ===================================
// ==== Level 1 Torch FLAMES HERE ====
// ===================================
position object 700,2045,575,-2087
position object 701,2045,575,-2087
yrotate object 701,90
position object 702,1868,575,-2087
position object 703,1868,575,-2087
yrotate object 703,90
iObjectFrame = 1
iLastTime = timer ( )
// ===============================
// ==== Level 2 Kitchen Decor ====
// ===============================
Make Object Box 603,50,15,1
Clone Object 604,603
Load image "Sign4.jpg",605
Texture Object 603,605
Texture Object 604,605
Position Object 603,550,491,-2185
Position Object 604,450,491,-2515
set object ambient 603,100
set object ambient 604,100
make object plane 608,100,100
make object plane 610,100,100
load image "animated\glowingcoals16\glowingcoals16.png",609
load image "animated\hotsteam16\hotsteam16.png",611
texture object 608,609
texture object 610,611
set object transparency 608,1
set object transparency 610,1
set object light 608,0
set object light 610,0
SET OBJECT ambience 608,1
SET OBJECT ambience 610,1
clone object 611,610,1
position object 608,555,403,-2451
position object 610,556,440,-2451
position object 611,556,440,-2451
yrotate object 611,90
scale object 608,40,40,80
scale object 610,120,50,80
scale object 611,120,50,80
xrotate object 608,90
set object speed 610,2
set object speed 611,2
make object plane 612,100,100
load image "animated\fire16\fire16.png",613
texture object 612,613
CLONE OBJECT 614,612
set object transparency 612,1
set object transparency 614,1
set object light 612,0
set object light 614,0
SET OBJECT ambience 612,1
SET OBJECT ambience 614,1
position object 612,555,403,-2451
position object 614,555,403,-2451
YROTATE OBJECT 614,90
scale object 612,135,60,70
scale object 614,135,60,70
iObjectFrame = 1
iLastTime = timer ( )
// ============================================
// ==== Level 4 South - Quest Object ====
// ============================================
Load Object "msapphire1.x",634,3
Load Image "msapphire1.bmp",635
position object 634,2840,240,-1451 //set up random location in future
Scale Object 634,400,400,400
sc_Setupobject 634,1,2
iObjectFrame = 1
iLastTime = timer ( )
// =======================================
// ====== Load Exit to Win Door Here ===========
// =======================================
Load Object "Secret_Wall2.X",40,3
Load Image "Secret_Door1.Bmp",3
sc_Setupobject 40,1,2
Texture Object 40,3
Position Object 40,2050,649,-1595
Scale Object 40,100,105,80
Set Object Speed 40,10
set object ambient 40,100
// ==============================================
// ====== Load Secret Door #1 Level 1 Here ======
// ==============================================
Load Object "Secret_Wall2.X",41,3
sc_Setupobject 41,1,2
Texture Object 41,3
Position Object 41,2450,550,-1860
Scale Object 41,100,105,80
Set Object Speed 41,10
set object ambient 41,100
// ==============================================
// ====== Load Secret Door #2 Level 1 Here ======
// ==============================================
Load Object "Secret_Wall2.X",42,3
sc_Setupobject 42,1,2
Texture Object 42,3
Position Object 42,1650,550,-2500
Scale Object 42,100,105,80
Set Object Speed 42,10
set object ambient 42,100
// ==============================================
// ====== Load Secret Door #3 Level 2 Here ======
// ==============================================
Load Object "Secret_Wall2.X",43,3
Load Image "Secret_Door2.Bmp",222
sc_Setupobject 43,1,2
Texture Object 43,222
Position Object 43,1200,450,-2650
YROTATE OBJECT 43,90
Scale Object 43,100,105,80
Set Object Speed 43,10
set object ambient 43,100
// ==============================================
// ====== Load Secret Door #4 Level 3 Here ======
// ==============================================
Load Object "Secret_Wall2.X",44,3
Load Image "Secret_Door3.Bmp",223
sc_Setupobject 44,1,2
Texture Object 44,223
Position Object 44,550,350,-1400
Scale Object 44,100,100,80
Set Object Speed 44,10
set object ambient 44,100
// ==============================================
// ====== Load Secret Door #5 Level 3 Here ======
// ==============================================
Load Object "Secret_Wall2.X",45,3
sc_Setupobject 45,1,2
Texture Object 45,223
Position Object 45,1350,350,-1100
Scale Object 45,100,100,80
Set Object Speed 45,10
set object ambient 45,100
// ==============================================
// ====== Load Secret Door #6 Level 4 Here ======
// ==============================================
Load Object "Secret_Wall2.X",46,3
sc_Setupobject 46,1,2
Texture Object 46,3
Position Object 46,1650,550,-2300
Scale Object 46,100,105,80
Set Object Speed 46,10
set object ambient 46,100
// ==============================================
// ====== Load Secret Door #1 Level 4 Here ======
// ==============================================
Load Object "Secret_Wall2.X",47,3
Load Image "Secret_Door4.Bmp",9
sc_Setupobject 47,1,2
Texture Object 47,9
Position Object 47,2350,250,-1300
Scale Object 47,100,100,90
Set Object Speed 47,10
set object ambient 47,100
// ==============================================
// ====== Load Secret Door #2 Level 4 Here ======
// ==============================================
Load Object "Secret_Wall2.X",48,3
sc_Setupobject 48,1,2
Texture Object 48,9
Position Object 48,2550,250,-1300
Scale Object 48,100,100,90
Set Object Speed 48,10
set object ambient 48,100
// ==============================================
// ====== Load Secret Door #2 Level 4 Here ======
// ==============================================
Load Object "Secret_Wall2.X",49,3
sc_Setupobject 49,1,2
Texture Object 49,9
Position Object 49,2550,250,-1400
Scale Object 49,100,100,90
Set Object Speed 49,10
set object ambient 49,100
// ==========================================================
// ==== Corridor 1 Access Door 1 from Level 1 To Level 2 ====
// ==========================================================
Load Object "Secret_Wall2.X",21,3
Texture Object 21,4
Position Object 21,1400,540,-1950
Yrotate Object 21,90
Scale Object 21,80,100,80
Set Object Speed 21,10
sc_Setupobject 21,1,2
// ==========================================================
// ==== Corridor 2 Access Door 2 from Level 1 To Level 2 ====
// ==========================================================
Load Object "Secret_Wall2.X",22,3
Texture Object 22,4
Position Object 22,1500,540,-2350
Yrotate Object 22,90
Scale Object 22,80,100,80
Set Object Speed 22,10
sc_Setupobject 22,1,2
// ========================================================
// ==== Corridor 1 Secret Door from Level 1 To Level 4 ====
// ========================================================
Load Object "Secret_Wall2.X",23,3
sc_Setupobject 23,1,2
Texture Object 23,222
Position Object 23,950,450,-1800
Scale Object 23,100,105,80
Set Object Speed 23,10
set object ambient 23,100
// ===============================================
// ==== Access Door 2 from Level 2 To Level 3 ====
// ===============================================
Load Object "Secret_Wall2.X",24,3
sc_Setupobject 24,1,2
Texture Object 24,222
Position Object 24,750,450,-1794
Scale Object 24,100,105,80
Set Object Speed 24,10
set object ambient 24,100
// ===============================================
// ==== Access Door 3 from Level 2 To Level 3 ====
// ===============================================
Load Object "Secret_Wall2.X",25,3
sc_Setupobject 25,1,2
Texture Object 25,222
Position Object 25,450,450,-2715
Scale Object 25,100,105,80
Set Object Speed 25,10
set object ambient 25,40
// ===============================================
// ==== Access Door 4 from Level 2 To Level 3 ====
// ===============================================
Load Object "Secret_Wall2.X",26,3
sc_Setupobject 26,1,2
Texture Object 26,222
Position Object 26,550,450,-1685
Scale Object 26,100,105,80
Set Object Speed 26,10
set object ambient 26,40
// ===============================================
// ==== Access Door 5 from Level 2 To Level 3 ====
// ===============================================
Load Object "Secret_Wall2.X",27,3
sc_Setupobject 27,1,2
Texture Object 27,222
Position Object 27,750,450,-2800
Scale Object 27,100,105,80
Set Object Speed 27,10
set object ambient 27,40
// ===============================================
// ==== Access Door 6 from Level 2 To Level 3 ====
// ===============================================
Load Object "Secret_Wall2.X",28,3
sc_Setupobject 28,1,2
Texture Object 28,222
Position Object 28,1150,450,-2819
Scale Object 28,100,105,80
Set Object Speed 28,10
set object ambient 28,40
// =========================================================
// ==== Access Door 1 from Level 3 To Level 4 in Armory ====
// =========================================================
Load Object "Secret_Wall2.X",29,3
sc_Setupobject 29,1,2
Texture Object 29,223
Position Object 29,1700,348,-1250
YROTATE OBJECT 29,90
Scale Object 29,100,105,80
Set Object Speed 29,10
set object ambient 29,40
// ============================
// ==== Level 1 Room Doors ====
// ============================
// ===== Load Door 1 Here =======
Load Object "Door1_Loop.X",51,3
Scale Object 51,100,100,100
Set Object Speed 51,45
// ===== Load Door 2 Here =======
Load Object "Door1_Loop.X",52,3
Scale Object 52,100,100,100
Set Object Speed 52,45
// ===== Load Door 3 Here =======
Load Object "Door1_Loop.X",53,3
Scale Object 53,100,100,100
Set Object Speed 53,45
// ===== Load Door 4 Here =======
Load Object "Door1_Loop.X",54,3
Scale Object 54,100,100,100
Yrotate Object 54,90
Set Object Speed 54,45
// ===== Load Door 5 Here =======
Load Object "Door1_Loop.X",55,3
Scale Object 55,100,100,100
Yrotate Object 55,90
Set Object Speed 55,45
// ===== Load Door 6 Here =======
Load Object "Door1_Loop.X",56,3
Scale Object 56,100,100,100
Yrotate Object 56,90
Set Object Speed 56,45
// ===== Load Door 7 Here =======
Load Object "Door1_Loop.X",57,3
Scale Object 57,100,100,100
Yrotate Object 57,90
Set Object Speed 57,45
// ===== Load Door 8 Here =======
Load Object "Door1_Loop.X",58,3
Scale Object 58,100,100,100
Set Object Speed 58,45
// ===== Load Door 9 Here =======
Load Object "Door1_Loop.X",59,3
Scale Object 59,100,100,100
Yrotate Object 59,90
Set Object Speed 59,45
// ============================
// ==== Level 2 Room Doors ====
// ============================
// ===== Load Door 1 Here =======
Load Object "Door1_Loop.X",61,3
Scale Object 61,100,100,100
Set Object Speed 61,45
// ===== Load Door 2 Here =======
Load Object "Door1_Loop.X",62,3
Scale Object 62,100,100,100
Set Object Speed 62,45
// ===== Load Door 3 Here =======
Load Object "Door1_Loop.X",63,3
Scale Object 63,100,100,100
Yrotate Object 63,90
Set Object Speed 63,45
// ===== Load Door 4 Here =======
Load Object "Door1_Loop.X",64,3
Scale Object 64,100,100,100
Yrotate Object 64,90
Set Object Speed 64,45
// ===== Load Door 5 Here =======
Load Object "Door1_Loop.X",65,3
Scale Object 65,100,100,100
Yrotate Object 65,90
Set Object Speed 65,45
// ===== Load Door 6 Here =======
Load Object "Door1_Loop.X",66,3
Scale Object 66,100,100,100
Set Object Speed 66,45
// ===== Load Door 7 Here =======
Load Object "Door1_Loop.X",67,3
Scale Object 67,100,100,100
Yrotate Object 67,90
Set Object Speed 67,45
// ===== Load Door 8 Here =======
Load Object "Door1_Loop.X",68,3
Scale Object 68,100,100,100
Yrotate Object 68,90
Set Object Speed 68,45
// ===== Load Door 9 Here =======
Load Object "Door1_Loop.X",69,3
Scale Object 69,100,100,100
Yrotate Object 69,90
Set Object Speed 69,45
// =========================
// ==== Load World Here ====
// =========================
Set Dir "Files"
Load Object "Levelbank\Testlevel\Universe.Dbo",World,3
sc_Setupcomplexobject World,1,20
Make Object Sphere Player,15
// Normal Starting position here - comment out if testing
Position Object Player,2050,623,-1700
// Normal Player Facing South - comment out if testing
YROTATE OBJECT Player,180
sc_Setupobject Player,2,1
Hide Object Player
Make Object Sphere Camobj,28
sc_Setupobject Camobj,3,1
Hide Object Camobj
Range=20000
set object speed Player,6400
// ==========================
// ==== Load Skybox Here ====
// ==========================
Set Dir ".."
Load image "Media\sky02.jpg",2
Make Object Sphere 2,-10000,50,50
Texture Object 2,2
Set Ambient Light 75
Fog On
Fog Distance Range
Set Object Light 2,1
Set Camera Range 0,1,Range
// ==========================================================
// ==========================================================
// ==== Place Level 1 Monster Cage Door Positioning Here ====
// ==========================================================
Position Object 51,1550,540,-1900 // Door# 1 Level 1
Position Object 52,1750,540,-2300 // Door# 2 Level 1
Position Object 53,1650,540,-2400 // Door# 3 Level 1
Position Object 54,2200,540,-2350 // Door# 4 Level 1
Position Object 55,2100,540,-2450 // Door# 5 Level 1
Position Object 56,2500,540,-2150 // Door# 6 Level 1
Position Object 57,2400,540,-1750 // Door# 7 Level 1
Position Object 58,1950,540,-1600 // Door# 8 Level 1
Position Object 59,1700,540,-1650 // Door# 9 Level 1
// ==========================================================
// ==== Place Level 2 Monster Cage Door Positioning Here ====
// ==========================================================
Position Object 61,1050,440,-1800 // Door# 1 Level 2
Position Object 62,650,440,-1900 // Door# 2 Level 2
Position Object 63,600,440,-1750 // Door# 3 Level 2
Position Object 64,500,440,-1950 // Door# 4 Level 2
Position Object 65,400,440,-2650 // Door# 5 Level 2
Position Object 66,1350,440,-2600 // Door# 6 Level 2
Position Object 67,1100,440,-2550 // Door# 7 Level 2
Position Object 68,1100,440,-2750 // Door# 8 Level 2
Position Object 69,700,440,-2650 // Door# 9 Level 2
// =============================================
// ========== Start Main Game Loop Here ========
// =============================================
Delete Sprite 1 // remove logo from screen
Cls
Loop Music 2 // start thunderstorm sound here
Set Music Volume 8,50
//==========================================
//======= Start Main Game Loop Here ========
//==========================================
Do
Set Object ambient 2,5
turn object right 2,.10
Randomize Timer()
//=====Rotate the Enchanted Gem Here =====
if OBJECT EXIST (634)
gem = gem + 1 : If Gem = 360 then Gem = 1
YROTATE OBJECT 634,Gem
endif
Moveplayer() // calls main game Function
// =======================================================
// ========== Animate Torch Flame Sprites Here ===========
// =======================================================
For ST = 700 to 899
SetTextureFrame(ST,iObjectFrame,4,4)
Next ST
SetTextureFrame(608,iObjectFrame,4,4)
SetTextureFrame(610,iObjectFrame,4,4)
SetTextureFrame(611,iObjectFrame,4,4)
SetTextureFrame(612,iObjectFrame,4,4)
SetTextureFrame(614,iObjectFrame,4,4)
SetTextureFrame(995,iObjectFrame,4,4)
SetTextureFrame(996,iObjectFrame,4,4)
SetTextureFrame(997,iObjectFrame,4,4)
SetTextureFrame(998,iObjectFrame,4,4)
if ( timer ( ) > iLastTime + 30 )
iLastTime = timer ( )
if ( iObjectFrame < 4 * 4 )
iObjectFrame = iObjectFrame + 1
else
iObjectFrame = 1
endif
endif
Sync
Loop
// ==================================================
// ============= End Main Game Loop Here ============
// ==================================================
End
// ===============================================
// >>>>>Functions and Subroutines Start Here<<<<<<
// ===============================================
// =======================================================
// ==== Function to Texture Special Items within Game ====
// =======================================================
function SetTextureFrame( iObject, iFrame, iFrameAcross, iFrameDown )
fTuSeg# = 1.0 / iFrameAcross
fTvSeg# = 1.0 / iFrameDown
iXTile = iFrame mod iFrameAcross
iYTile = ( iFrameDown - 1 ) - ( ( iFrame - iXTile ) / iFrameAcross )
fTu# = fTuSeg# * iXTile ;
fTv# = 1.0 - ( fTvSeg# * iYTile )
lock vertexdata for limb iObject, 0
set vertexdata uv 0, 0, fTu# + fTuSeg#, fTv# - fTvSeg#
set vertexdata uv 1, 0, fTu#, fTv# - fTvSeg#
set vertexdata uv 2, 0, fTu# + fTuSeg#, fTv#
set vertexdata uv 3, 0, fTu#, fTv# - fTvSeg#
set vertexdata uv 4, 0, fTu#, fTv#
set vertexdata uv 5, 0, fTu# + fTuSeg#, fTv#
unlock vertexdata
endfunction
// ==================================================
// ==== Function To Check If Close to an Object =====
// ==================================================
Function CheckDistance(Obj1,Obj2)
Set Vector3 1,(Object Position X(Obj1)-Object Position X(Obj2)),(Object Position Y(Obj1)-Object Position Y(Obj2)),(Object Position Z(Obj1)-Object Position Z(Obj2))
Dist# = Length Vector3(1)
Endfunction Dist#
// =========================================================================================
// =========================================================================================
// =========================================================================================
// =========================================================================================
Function Moveplayer()
// ==== Store Old Coordinates ====
Px# = Object Position X(Player)
Py# = Object Position Y(Player)
Pz# = Object Position Z(Player)
Stats()
Switches()
// ==== Get User Input ====
Ax# = Camera Angle X() : Ay# = Camera Angle Y()
Ax# = Wrapvalue(Ax# + (Mousemovey() * .13) )
Ay# = Wrapvalue(Ay# + (Mousemovex() * .13) )
rotate object Player,Ax#,ay#,object angle z(Player)
If Mouseclick() = 1
Px# = newXvalue(Px#,Ay#,Pspeed#)
Pz# = newZvalue(Pz#,Ay#,Pspeed#)
position object Player,Px#,Py#,Pz#
endif
If Mouseclick() = 2
Px# = newXvalue(Px#,Ay#,-Pspeed#)
Pz# = newZvalue(Pz#,Ay#,-Pspeed#)
position object Player,Px#,Py#,Pz#
endif
// ==== Get Current Coordinates Of The Player ====
Cx# = Object Position X(Player)
Cy# = Object Position Y(Player)
Cz# = Object Position Z(Player)
` Collide = sc_Sphereslidegroup(player,Px#,Py#,Pz#,Cx#,Cy#,Cz#,Radius#,0)
// ==== Collided With World - Get New Coordinates ====
If Collide > 0
Sx# = sc_Getcollisionslidex()
Sy# = sc_Getcollisionslidey()
Sz# = sc_Getcollisionslidez()
Position Object Player,Sx#,Sy#,Sz#
// ==== Hit The Ground - Reset Gravity ====
Gravity# = 0.5
Else
// ==== No Collision - Apply Gravity ====
If Gravity# < 10.0 Then Inc Gravity#,.02
Dec Cy#,Gravity#
Position Object Player,Cx#,Cy#,Cz#
sc_Updateobject Player
for SS = 21 to 29:sc_Updateobject SS:next SS
Collide = sc_Sphereslidegroup(1,Px#,Py#,Pz#,Cx#,Cy#,Cz#,Radius#,0)
If Collide > 0
Sx# = sc_Getcollisionslidex()
Sy# = sc_Getcollisionslidey()
Sz# = sc_Getcollisionslidez()
Position Object Player,Sx#,Sy#,Sz#
// ==== Hit The Ground - Reset Gravity ====
Gravity# = 0.5
Endif
Endif
sc_Updateobject Player
// ==== Position Camera Behind Player ====
Cx# = Object Position X(Player)
Cy# = Object Position Y(Player)
Cz# = Object Position Z(Player)
` Oldx# = Object Position X(Camobj)
` Oldy# = Object Position Y(Camobj)
` Oldz# = Object Position Z(Camobj)
Position camera Cx#,Cy# + 15.0,Cz#
Set Camera To Object Orientation Player
Move Camera -30.0
point camera Cx#,Cy# + 15.0,Cz#
` sc_Updateobject Camobj
` Newx# = Object Position X(Camobj)
` Newy# = Object Position Y(Camobj)
` Newz# = Object Position Z(Camobj)
` Collide = sc_Sphereslide(World,Oldx#,Oldy#,Oldz#,Newx#,Newy#,Newz#,Camradius#,0)
` If Collide > 0
` Newx# = sc_Getcollisionslidex()
` Newy# = sc_Getcollisionslidey()
` Newz# = sc_Getcollisionslidez()
` Endif
` Position Camera Newx#,Newy#,Newz#
` Point Camera Cx#,Newy#,Cz#
sc_Updateobject Player
for SS = 21 to 29:sc_Updateobject SS:next SS
sc_Updateobject 31
sc_Updateobject 32
sc_Updateobject 33
sc_Updateobject 34
for Sr = 40 to 49:sc_Updateobject Sr:next Sr // secret doors
sc_Updateobject 400
sc_Updateobject 402
sc_Updateobject 403
sc_Updateobject 404
sc_Updateobject 405
sc_Updateobject 406
sc_Updateobject 407
sc_Updateobject 408
sc_Updateobject 409
sc_Updateobject 632
sc_Updateobject 633
if OBJECT EXIST (634) then sc_Updateobject 634
// =====================================
// ======== Open Exit Door Here =======
// =====================================
Dist#=CheckDistance(Player,40)
Door0 = Object Frame(40)
if int(Pz#) = -1624 and Int(Px#) > 2025 and Int(Px#) < 2074 and Win=0 and int(Py#) > 600 then Center text (Screen Width()/2),(Screen Height()/2)+320,"Door Locked."
Gosub Verify
If Object Playing(40)=0 and Win <> 0 : sc_Setobjectcollisionoff 40
If Dist# < 70.0 And Dist# > 68.0 And Door0 = 0 :sc_Setobjectcollisionon 40 : Play Music 5 : Play Object 40,0,16
Endif
Endif
// =====================================
// ===== Open Door #1 Here =======
// =====================================
Dist#=CheckDistance(Player,31)
Door1 = Object Frame(31)
Switch1Pos = Object Frame(400)
If Object Playing(31)=0 and Switch1Pos <> 0 : sc_Setobjectcollisionoff 31
If Dist# < 70.0 And Dist# > 68.0 And Door1=0 and Switch1Pos <> 0 :sc_Setobjectcollisionon 31 : Play Music 5 : Play Object 31,0,16
Endif
Endif
// =====================================
// ===== Open Door #2 Here =======
// =====================================
Dist#=CheckDistance(Player,32)
Door2 = Object Frame(32)
Switch2Pos = Object Frame(404)
If Object Playing(32)=0 and Switch2Pos <> 0 : sc_Setobjectcollisionoff 32
If Dist# < 70.0 And Dist# > 68.0 And Door2=0 and Switch2Pos <> 0 : sc_Setobjectcollisionon 32 : Play Music 5 : Play Object 32,0,16
Endif
Endif
// =====================================
// ===== Open Door #3 Here =======
// =====================================
Dist#=CheckDistance(Player,33)
Door3 = Object Frame(33)
Switch3Pos = Object Frame(403)
If Object Playing(33)=0 and Switch3Pos <> 0 : sc_Setobjectcollisionoff 33
If Dist# < 70.0 And Dist# > 68.0 And Door3=0 and Switch3Pos <> 0 : sc_Setobjectcollisionon 33 : Play Music 5 : Play Object 33,0,16
Endif
Endif
// =====================================
// ===== Open Door #4 Here =======
// =====================================
Dist#=CheckDistance(Player,34)
Door4 = Object Frame(34)
Switch4Pos = Object Frame(402)
If Object Playing(34)=0 and Switch4Pos <> 0 : sc_Setobjectcollisionoff 34
If Dist# < 70.0 And Dist# > 68.0 And Door4=0 and Switch4Pos <> 0 : sc_Setobjectcollisionon 34 : Play Music 5 : Play Object 34,0,16
Endif
Endif
// ============================================
// ===== Open Door #2 inside Here =======
// ============================================
Dist#=CheckDistance(Player,32)
Door5 = Object Frame(32)
Switch5Pos = Object Frame(407)
If Object Playing(32)=0 and Switch5Pos <> 0 : sc_Setobjectcollisionoff 32
If Dist# < 70.0 And Dist# > 68.0 And Door5=0 and Switch5Pos <> 0 : sc_Setobjectcollisionon 32 : Play Music 5 : Play Object 32,0,16
Endif
Endif
// ============================================
// ===== Open Door #1 inside Here =======
// ============================================
Dist#=CheckDistance(Player,31)
Door1 = Object Frame(31)
Switch6Pos = Object Frame(408)
If Object Playing(31)=0 and Switch6Pos <> 0 : sc_Setobjectcollisionoff 31
If Dist# < 70.0 And Dist# > 68.0 And Door1=0 and Switch6Pos <> 0 : sc_Setobjectcollisionon 31 : Play Music 5 : Play Object 31,0,16
Endif
Endif
// ================================================
// ===== Use Switch #1 & #5 Here =======
// ================================================
Dist#=CheckDistance(Player,400)
Switch1 = Object Frame(400)
Switch6 = Object Frame(408)
If Object Playing(400)=0 : sc_Setobjectcollisionoff 400
If Dist# < 30.0 And Dist# > 25.0 And Switch6 = 0 and Switch1 = 0
Center text (Screen Width()/2),(Screen Height()/2)+320,"Press Enter to Use!!"
If ASC(INKEY$()) = 13 : sc_Setobjectcollisionon 400 : stop music 12 : Play Object 400,0,16 : play music 12
Endif
Endif
Endif
If Object Playing(400)=0 : sc_Setobjectcollisionoff 400
If Dist# < 30.0 And Dist# > 25.0 And Switch1 = 0 and Switch6 <> 0
Center text (Screen Width()/2),(Screen Height()/2)+320,"Passage Door #1 Already Open!"
Endif
Endif
Dist#=CheckDistance(Player,408)
If Object Playing(408)=0 : sc_Setobjectcollisionoff 408
If Dist# < 35.0 And Dist# > 20.0 And Switch1 = 0 and Switch6 = 0
Center text (Screen Width()/2),(Screen Height()/2)+320,"Press Enter to Access !!"
If ASC(INKEY$()) = 13 : sc_Setobjectcollisionon 408 : stop music 12 : Play Object 408,0,16 : play music 12
Endif
Endif
Endif
If Object Playing(408)=0 : sc_Setobjectcollisionoff 408
If Dist# < 35.0 And Dist# > 20.0 And Switch6 = 0 and Switch1 <> 0
Center text (Screen Width()/2),(Screen Height()/2)+320," Door Access Already Available!"
Endif
Endif
// ===========================================
// ===== Use Switch #2 Here =======
// ===========================================
Dist#=CheckDistance(Player,402)
Switch2 = Object Frame(402)
If Object Playing(402)=0 : sc_Setobjectcollisionoff 402
If Dist# < 30.0 And Dist# > 25.0 And Switch2 = 0
Center text (Screen Width()/2),(Screen Height()/2)+320,"Press Enter to Use!!"
If ASC(INKEY$()) = 13 : sc_Setobjectcollisionon 402 : stop music 12 : Play Object 402,0,16 : play MUSIC 12
Endif
Endif
Endif
// ===========================================
// ===== Use Switch #3 Here =======
// ===========================================
Dist#=CheckDistance(Player,403)
Switch3 = Object Frame(403)
If Object Playing(403)=0 : sc_Setobjectcollisionoff 403
If Dist# < 30.0 And Dist# > 25.0 And Switch3 = 0
Center text (Screen Width()/2),(Screen Height()/2)+320,"Press Enter to Use!!"
If ASC(INKEY$()) = 13 : sc_Setobjectcollisionon 403 : stop music 12 : Play Object 403,0,16 : play MUSIC 12
Endif
Endif
Endif
// ================================================
// ===== Use Switch #4 & #5 Here =======
// ================================================
Dist#=CheckDistance(Player,404)
Switch4 = Object Frame(404)
Switch5 = Object Frame(407)
If Object Playing(404)=0 : sc_Setobjectcollisionoff 404
If Dist# < 30.0 And Dist# > 25.0 And Switch5 = 0 and Switch4 = 0
Center text (Screen Width()/2),(Screen Height()/2)+320,"Press Enter to Use!!"
If ASC(INKEY$()) = 13 : sc_Setobjectcollisionon 404 : stop music 12 : Play Object 404,0,16 : play music 12
Endif
Endif
Endif
If Object Playing(404)=0 : sc_Setobjectcollisionoff 404
If Dist# < 30.0 And Dist# > 25.0 And Switch4 = 0 and Switch5 <> 0
Center text (Screen Width()/2),(Screen Height()/2)+320,"Passage Door #2 Access Already Available!"
Endif
Endif
Dist#=CheckDistance(Player,407)
If Object Playing(407)=0 : sc_Setobjectcollisionoff 407
If Dist# < 30.0 And Dist# > 25.0 And Switch5 = 0 and Switch4 = 0
Center text (Screen Width()/2),(Screen Height()/2)+320,"Press Enter to Access !!"
If ASC(INKEY$()) = 13 : sc_Setobjectcollisionon 407 : stop music 12 : Play Object 407,0,16 : play music 12
Endif
Endif
Endif
If Object Playing(407)=0 : sc_Setobjectcollisionoff 407
If Dist# < 30.0 And Dist# > 25.0 And Switch5 = 0 and Switch4 <> 0
Center text (Screen Width()/2),(Screen Height()/2)+320," Access Already Available!"
Endif
Endif
// =============================================
// ===== Use Level 2 Release Switch Here =======
// =============================================
Dist#=CheckDistance(Player,405)
Lever1 = Object Frame(405)
If Object Playing(405)=0 : sc_Setobjectcollisionoff 405
If Dist# < 30.0 And Dist# > 21.0 And Lever1 = 0
Center text (Screen Width()/2),(Screen Height()/2)+320,"Press Enter to allow Access to Level 2!!"
If ASC(INKEY$()) = 13 : sc_Setobjectcollisionon 405 : stop music 13 : Play Object 405,0,16 : play music 13
Endif
Endif
Endif
// =============================================
// ===== Use Level 3 Release Switch Here =======
// =============================================
Dist#=CheckDistance(Player,406)
Lever1 = Object Frame(406)
If Object Playing(406)=0 : sc_Setobjectcollisionoff 406
If Dist# < 30.0 And Dist# > 21.0 And Lever1 = 0
Center text (Screen Width()/2),(Screen Height()/2)+320,"Press Enter to allow Access to Level 3!!"
If ASC(INKEY$()) = 13 : sc_Setobjectcollisionon 406 : stop music 13 : Play Object 406,0,16 : play music 13
Endif
Endif
Endif
// =============================================
// ===== Use Level 4 Release Switch Here =======
// =============================================
Dist#=CheckDistance(Player,409)
Lever1 = Object Frame(409)
If Object Playing(409)=0 : sc_Setobjectcollisionoff 409
If Dist# < 30.0 And Dist# > 21.0 And Lever1 = 0
Center text (Screen Width()/2),(Screen Height()/2)+320,"Press Enter to allow Access to Level 4!!"
If ASC(INKEY$()) = 13 : sc_Setobjectcollisionon 409 : stop music 13 : Play Object 409,0,16 : play music 13
Endif
Endif
Endif
// =============================================
// ===== Use Level 5 Release Switch Here =======
// =============================================
Dist#=CheckDistance(Player,410)
Lever1 = Object Frame(410)
If Object Playing(410)=0 : sc_Setobjectcollisionoff 410
If Dist# < 30.0 And Dist# > 21.0 And Lever1 = 0
Center text (Screen Width()/2),(Screen Height()/2)+320,"Press Enter to allow Access to Level 5!!"
If ASC(INKEY$()) = 13 : sc_Setobjectcollisionon 410 : stop music 13 : Play Object 410,0,16 : play music 13
Endif
Endif
Endif
// ==========================
// ==== Secret Door #1 ======
// ==========================
Dist#=CheckDistance(Player,41)
Sdoorpos = Object Frame(41)
If Secret = 0 Then Goto Sdlock
If Object Playing(41)=0 : sc_Setobjectcollisionoff 41
If Dist# < 70.0 And Dist# > 68.0 And Sdoorpos=0 : sc_Setobjectcollisionon 41 : Play Music 5 : Play Object 41,0,16
Endif
Endif
// ==========================
// ==== Secret Door #2 ======
// ==========================
Dist#=CheckDistance(Player,42)
Sdoorpos = Object Frame(42)
If Secret = 0 Then Goto Sdlock
If TFlag(3) = 0 and (Int(Px#) > 1600 and (Int(Pz#) > -2574 and Int(Pz#) < -2530)) or TFlag(3) = 0 and (Int(Pz#) > -2669 and (Int(Px#) < 1674 and Int(Px#) > 1625))
If Object Playing(42)=0 : sc_Setobjectcollisionoff 42
If Dist# < 70.0 And Dist# > 68.0 And Sdoorpos=0 : sc_Setobjectcollisionon 42 : Play Music 5 : Play Object 42,0,16
Endif
Endif
endif
// ==========================
// ==== Secret Door #3 ======
// ==========================
Dist#=CheckDistance(Player,43)
Sdoorpos = Object Frame(43)
If Secret = 0 Then Goto Sdlock
If Object Playing(43)=0 : sc_Setobjectcollisionoff 43
If Dist# < 70.0 And Dist# > 68.0 And Sdoorpos=0 : sc_Setobjectcollisionon 43 : Play Music 5 : Play Object 43,0,16
Endif
Endif
// ================================
// ==== Secret Door #4 LVL 3 ======
// ================================
Dist#=CheckDistance(Player,44)
Sdoorpos = Object Frame(44)
If Secret = 0 Then Goto Sdlock
If Object Playing(44)=0 : sc_Setobjectcollisionoff 44
If Dist# < 70.0 And Dist# > 68.0 And Sdoorpos=0 : sc_Setobjectcollisionon 44 : Play Music 5 : Play Object 44,0,16
Endif
Endif
// ================================
// ==== Secret Door #5 LVL 3 ======
// ================================
Dist#=CheckDistance(Player,45)
Sdoorpos = Object Frame(45)
If Secret = 0 Then Goto Sdlock
If Object Playing(45)=0 : sc_Setobjectcollisionoff 45
If Dist# < 70.0 And Dist# > 68.0 And Sdoorpos=0 : sc_Setobjectcollisionon 45 : Play Music 5 : Play Object 45,0,16
Endif
Endif
// ==========================
// ==== Secret Door #6 ======
// ==========================
Dist#=CheckDistance(Player,46)
Sdoorpos = Object Frame(46)
If Secret = 0 Then Goto Sdlock
If Object Playing(46)=0 : sc_Setobjectcollisionoff 46
If Dist# < 70.0 And Dist# > 68.0 And Sdoorpos=0 : sc_Setobjectcollisionon 46 : Play Music 5 : Play Object 46,0,16
Endif
Endif
// ==================================
// ==== Secret Door #1 Level 4 ======
// ==================================
Dist#=CheckDistance(Player,47)
Sdoorpos = Object Frame(47)
If Secret = 0 Then Goto Sdlock
If Object Playing(47)=0 : sc_Setobjectcollisionoff 47
If Dist# < 70.0 And Dist# > 68.0 And Sdoorpos=0 : sc_Setobjectcollisionon 47 : Play Music 5 : Play Object 47,0,16
Endif
Endif
// ==================================
// ==== Secret Door #2 Level 4 ======
// ==================================
Dist#=CheckDistance(Player,48)
Sdoorpos = Object Frame(48)
If Secret = 0 Then Goto Sdlock
If Object Playing(48)=0 : sc_Setobjectcollisionoff 48
If Dist# < 70.0 And Dist# > 68.0 And Sdoorpos=0 : sc_Setobjectcollisionon 48 : Play Music 5 : Play Object 48,0,16
Endif
Endif
// ==================================
// ==== Secret Door #3 Level 4 ======
// ==================================
Dist#=CheckDistance(Player,49)
Sdoorpos = Object Frame(49)
If Secret = 0 Then Goto Sdlock
If Object Playing(49)=0 : sc_Setobjectcollisionoff 49
If Dist# < 70.0 And Dist# > 68.0 And Sdoorpos=0 : sc_Setobjectcollisionon 49 : Play Music 5 : Play Object 49,0,16
Endif
Endif
// ==============================================
// ==== Secret Door #6 to LVL 4 from LVL 2 ======
// ==============================================
Dist#=CheckDistance(Player,23)
Sdoorpos = Object Frame(23)
If Secret = 0 Then Goto Sdlock
If Object Playing(23)=0 : sc_Setobjectcollisionoff 23
If Dist# < 70.0 And Dist# > 68.0 And Sdoorpos=0 : sc_Setobjectcollisionon 23 : Play Music 5 : Play Object 23,0,16
Endif
Endif
Sdlock:
// ==============================================
// =====Open Corridor Door #1 Lvl 1 Here ========
// ==============================================
Dist#=CheckDistance(Player,21)
Corr1 = Object Frame(21)
L1pos = Object Frame(405)
If int(Px#) = 1429 and Int(Pz#) > -1974 and Int(Pz#) < -1925 and L1Pos=0 then Center text (Screen Width()/2),(Screen Height()/2)+320,"Passage to Level 2 is Blocked!! Look for Release Lever on Level 1."
If Object Playing(21)=0 and L1pos > 1 : sc_Setobjectcollisionoff 21
If Dist# < 70.0 And Dist# > 68.0 And Corr1=0: sc_Setobjectcollisionon 21 : Play Music 5 : Play Object 21,0,16
Endif
Endif
// ==============================================
// =====Open Corridor Door #2 Lvl 1 Here ========
// ==============================================
Dist#=CheckDistance(Player,22)
Corr2 = Object Frame(22)
L1pos = Object Frame(405)
If int(Px#) = 1529 and Int(Pz#) > -2374 and Int(Pz#) < -2325 and L1Pos=0 then Center text (Screen Width()/2),(Screen Height()/2)+320,"Passage to Level 2 is Blocked!! Look for Release Lever on Level 1."
If Object Playing(22)=0 and L1pos > 1 : sc_Setobjectcollisionoff 22
If Dist# < 70.0 And Dist# > 68.0 And Corr2=0: sc_Setobjectcollisionon 22 : Play Music 5 : Play Object 22,0,16
Endif
Endif
// ==============================================
// =====Open Corridor Door #2 Lvl 2 Here ========
// ==============================================
Dist#=CheckDistance(Player,24)
Corr4 = Object Frame(24)
L2pos = Object Frame(406)
If int(Pz#) > -1824 and Int(Px#) > 700 and Int(Px#) < 795 and L2Pos=0 and int(Py#) = 423 then Center text (Screen Width()/2),(Screen Height()/2)+320,"Passage to Level 3 is Blocked!! Look for Release Lever on Level 2."
If Object Playing(24)=0 and L2pos > 1 : sc_Setobjectcollisionoff 24
If Dist# < 70.0 And Dist# > 68.0 And Corr4=0: sc_Setobjectcollisionon 24 : Play Music 5 : Play Object 24,0,16
Endif
Endif
// ==============================================
// =====Open Corridor Door #3 Lvl 2 Here ========
// ==============================================
Dist#=CheckDistance(Player,25)
Corr5 = Object Frame(25)
L2pos = Object Frame(406)
If int(Px#) > 425 and Int(Px#) < 474 and Int(Pz#) < -2680 and L2Pos=0 and int(Py#) = 423 then Center text (Screen Width()/2),(Screen Height()/2)+320,"Passage to Level 3 is Blocked!! Look for Release Lever on Level 2."
If Object Playing(25)=0 and L2pos > 1: sc_Setobjectcollisionoff 25
If Dist# < 70.0 And Dist# > 68.0 And Corr5=0: sc_Setobjectcollisionon 25 : Play Music 5 : Play Object 25,0,16
Endif
Endif
// ==============================================
// =====Open Corridor Door #4 Lvl 2 Here ========
// ==============================================
Dist#=CheckDistance(Player,26)
Corr6 = Object Frame(26)
L2pos = Object Frame(406)
If int(Px#) > 525 and Int(Px#) < 595 and Int(Pz#) > -1719 and L2Pos=0 and int(Py#) = 423 then Center text (Screen Width()/2),(Screen Height()/2)+320,"Passage to Level 3 is Blocked!! Look for Release Lever on Level 2."
If Object Playing(26)=0 and L2pos > 1 : sc_Setobjectcollisionoff 26
If Dist# < 70.0 And Dist# > 68.0 And Corr6=0: sc_Setobjectcollisionon 26 : Play Music 5 : Play Object 26,0,16
Endif
Endif
// ==============================================
// =====Open Corridor Door #5 Lvl 2 Here ========
// ==============================================
Dist#=CheckDistance(Player,27)
Corr7 = Object Frame(27)
L2pos = Object Frame(406)
If int(Px#) > 725 and Int(Px#) < 774 and Int(Pz#) < -2769 and L2Pos=0 and int(Py#) = 423 then Center text (Screen Width()/2),(Screen Height()/2)+320,"Passage to Level 3 is Blocked!! Look for Release Lever on Level 2."
If Object Playing(27)=0 and L2pos > 1: sc_Setobjectcollisionoff 27
If Dist# < 70.0 And Dist# > 68.0 And Corr7=0: sc_Setobjectcollisionon 27 : Play Music 5 : Play Object 27,0,16
Endif
Endif
// ==============================================
// =====Open Corridor Door #6 Lvl 2 Here ========
// ==============================================
Dist#=CheckDistance(Player,28)
Corr8 = Object Frame(28)
L2pos = Object Frame(406)
If int(Px#) > 1125 and Int(Px#) < 1174 and Int(Pz#) < -2788 and L2Pos=0 and int(Py#) = 423 then Center text (Screen Width()/2),(Screen Height()/2)+320,"Passage to Level 3 is Blocked!! Look for Release Lever on Level 2."
If Object Playing(28)=0 and L2pos > 1 : sc_Setobjectcollisionoff 28
If Dist# < 70.0 And Dist# > 68.0 And Corr8=0: sc_Setobjectcollisionon 28 : Play Music 5 : Play Object 28,0,16
Endif
Endif
// ==============================================
// =====Open Corridor Door #1 Lvl 3 Here ========
// ==============================================
Dist#=CheckDistance(Player,29)
Corr8 = Object Frame(29)
L2pos = Object Frame(409)
If int(Px#) > 1665 and Int(Px#) < 1675 and Int(Pz#) < -1225 and L2Pos=0 and int(Py#) = 323 then Center text (Screen Width()/2),(Screen Height()/2)+320,"Passage to Level 4 is Blocked!! Look for Release Lever on Level 3."
If Object Playing(29)=0 and L2pos > 1 : sc_Setobjectcollisionoff 29
If Dist# < 70.0 And Dist# > 68.0 And Corr8=0: sc_Setobjectcollisionon 29 : Play Music 5 : Play Object 29,0,16
Endif
Endif
// ============================================
// ===== Grab Gem for Crypt access Here =======
// ============================================
if Object Exist(634)
Dist#=CheckDistance(Player,634)
if Gem1 = 1 then sc_Setobjectcollisionoff 634
If Dist# < 70.0 And Dist# > 21.0 and Gem1 = 0
Center text (Screen Width()/2),(Screen Height()/2)+320,"Press Enter to Collect Enchanted Gem!!"
If ASC(INKEY$()) = 13 : sc_Setobjectcollisionon 634 : Hide OBJECT 634 : Gem1 = 1 : sc_Setobjectcollisionoff 634 : DELETE OBJECT 634 :
Endif
Endif
endif
// ============================
// ==== Check Levels/Rooms ====
// ============================
if int(Py#) = 623 then Level = 0 : Current = 0 : SET MUSIC VOLUME 2,80
if int(Py#) = 523 then Level = 1 : Current = 1 : SET MUSIC VOLUME 2,60
if int(Py#) = 423 then Level = 2 : Current = 2 : SET MUSIC VOLUME 2,25
if int(Py#) = 323 then Level = 3 : Current = 3 : SET MUSIC VOLUME 2,10
if int(Py#) = 223 then Level = 4 : Current = 4 : SET MUSIC VOLUME 2,0
// ==============================================================
// ============== Level 2 Monsters ==============================
// ==============================================================
// =============================================
// ===== Encounter Warrior #1 Here =======
// =============================================
X = 850 // X location of Monster/Treasure
X1 = X
Y = 450 // Y Location of Monster/Treasure
Y1=Y
Z = -2250 // Z Location of Monster/Treasure
Z1=Z
S=1
R3=157 // Treasure Front Rotate
Tc2=301 // Treasure Object #
PO#=435
Lx# = 990
Ly# = 423
Lz# = -2350
Rx# = 850
Rz# = -2250
RoamNum = 1001
AniStart = 24000
AniStop = 33000
LoseStart = 53000
LoseStop = 64000
MsoundStart = 9
MsoundEnd = 10
Trsr_Lvl = 19
T=Rnd(8)+Trsr_Lvl
Gosub BuildR
S2 = T-(Trsr_Lvl-1)
Level = 2
Gosub ShowRoam
// ==============================================================
// ============== INFO FOR ROOMS PER LEVEL ======================
// ==============================================================
// ================================
// ==== Door Room #1 Level 1 ======
// ================================
TF = 1
RmLvl = 1
NumZout = -1920 // PZ# Outside
NumZin = -1870 // PZ# Inside
HighNum = 1575 // High # Range for PX#
LowNum = 1520 // Low # Range for PX#
Objnum = 51
Lx# = 1550 // X,Y,Z location of player when lose
Ly# = 550
Lz# = -1950
D1=152 // Monster Front no Rotate
D3=153 // Treasure Front no Rotate
D2=102 // Monster Object #
Tc2=103 // Treasure Object #
X = 1550 // X location of Monster/Treasure
X1 = X
Y = 550 // Y Location of Monster/Treasure
Y1=Y
Z = -1830 // Z Location of Monster/Treasure
Z1=Z
Mstr_Lvl = 88 // Level 1 Random Number range
Trsr_Lvl = 10 // Level 1 Random Number range
Lvl = 1
Gosub CheckRoomN:
ENDFUNCTION
// ==============================================================================
// ==============================================================================
// ==============================================================================
// ==============================================================================
// ==============================================================================
// ==============================================================================
enditall:
rem you have died
end
When old programmers die...do they decompile?