Currently me and group mates are developing a game and based it in a novel....
but we experience a big problem when we tried o load the second map...
we are using 3d world studio in creating a map and objects in .DBO format.
i don't know whats the problem on why the game is too slow..
+ Code Snippetset display mode 800,600,16
sync on : sync rate 60
sync off
disable escapekey
rem SET UP =================================================================================
setup:
Set Camera Range .1, 5000
Global ColliderObjNum As Integer
ColliderObjNum = 2
Global MovePerSec As Float
MovePerSec = 240
Global UseReticle As Boolean
UseReticle = 1
Global EyeHeight As Integer
EyeHeight = 70
Global MouseSens As integer
MouseSens = 3
Global Airborn as Boolean
Global Gravity as Float
Gravity = 512
rem END of SET UP =========================================================================
rem LOADING =================================================================
sandiego:
hide mouse
sync on
sync
part1_map()
sync
part1:
sync
load image "\media\picture\manus.jpg",10,1
paste image 10,100,0,0
ink RGB(74,72,72,),1
set text size 30
set text font "magneto"
center text screen width()/2,140, "PART I"
wait key
goto mainloop
mainloop:
do
if Airborn=0 then CheckCollision()
if Airborn=1 then Fall()
Sync
loop
function part1_map()
Load Object "C:\THESIS_MAN\media\maps\part1map\sandiego.dbo", 1
Set Object Collision To Polygons 1
load object "C:\THESIS_MAN\media\sky\sky.x", 3
set object collision off 3
set object 3,1,1,0,0,0,0,0
scale object 3,5000000,500000,5000000
Make Object Sphere ColliderObjNum, EyeHeight/2
Set Object Collision On ColliderObjNum
Hide Object ColliderObjNum
Position Camera 0, 0, 0, 0
Position Object ColliderObjNum, 10, 100, 100
set camera range 0,1,3000000
Set Ambient Light 100
Fog Color RGB(128,128,128)
Fog Distance 5000
Fog On
sync
goto part1
endfunction
Function CheckCollision()
Moving = 0
ox#=Object Position x(ColliderObjNum)
oy#=Object Position y(ColliderObjNum)
oz#=Object Position z(ColliderObjNum)
Delta#=MovePerSec/Screen FPS()
If Delta#>EyeHeight
Delta#=EyeHeight
EndIf
Rotate Object ColliderObjNum, Object Angle x(ColliderObjNum)+(MouseMovey()/MouseSens),Object Angle y(ColliderObjNum)+(MouseMovex()/MouseSens),0
If Object Angle x(ColliderObjNum)>90 then XRotate Object ColliderObjNum,90
If Object Angle x(ColliderObjNum)<-90 then XRotate Object ColliderObjNum,-90
cx#=Object Angle x(ColliderObjNum)
cy#=Object Angle y(ColliderObjNum)
cz#=Object Angle z(ColliderObjNum)
Rotate Camera cx#, cy#, cz#
Rotate Object ColliderObjNum, cx#, cy#, cz#
If UseReticle = 1
circle screen width()/2,screen height()/2,8
EndIf
k$=upper$(Inkey$())
`This code constitutes the movement functionality
If keystate(17)=1
`move the player forward
XRotate Object ColliderObjNum,0
Move Object ColliderObjNum,Delta#
XRotate Object ColliderObjNum,cx#
EndIf
If keystate(31)=1
`move the player backwards
XRotate Object ColliderObjNum,0
Move Object ColliderObjNum,0-Delta#
XRotate Object ColliderObjNum,cx#
EndIf
If keystate(30)=1
`strafe left
XRotate Object ColliderObjNum,0
YRotate Object ColliderObjNum,cy#-90
Move Object ColliderObjNum,Delta#
YRotate Object ColliderObjNum,cy#
XRotate Object ColliderObjNum,cx#
EndIf
If keystate(32)=1
`strafe right
XRotate Object ColliderObjNum,0
YRotate Object ColliderObjNum,cy#-90
Move Object ColliderObjNum,0-Delta#
YRotate Object ColliderObjNum,cy#
XRotate Object ColliderObjNum,cx#
EndIf
nx#=Object Position x(ColliderObjNum)
nz#=Object Position z(ColliderObjNum)
ny#=EyeHeight + (oy#-Intersect Object(1, nx#, oy#, nz#, nx#, -1000, nz#))
if nx# > ox#
newxwest# = intersect object(1,nx#,ny#,nz#,nx#+(EyeHeight/2),ny#,nz#)
endif
if newxwest# > 0
if newxwest# < object size x(2)/2
nx# = ox#
endif
endif
if object collision(ColliderObjNum,0) <> 0
position object ColliderObjNum, ox#, ny#, nz#
if object collision(ColliderObjNum, 0)<>0
Position object ColliderObjNum, nx#, ny#, oz#
If Object Collision(ColliderObjNum, 0)<>0
If Object Collision(ColliderObjNum, 0)<>0
ny#=oy#
nx#=ox#
nz#=oz#
Else
ny#=oy#
EndIf
Else
nz#=oz#
EndIf
else
nx# = ox#
endif
EndIf
if (oy#-ny#) > EyeHeight
AirBorn = 1
ny#=oy#
CheckFall()
EndIF
Position Camera 0, nx#, ny#, nz#
Position Object ColliderObjNum, nx#, ny#, nz#
EndFunction
Function CheckFall()
ox#=Object Position x(ColliderObjNum)
oy#=Object Position y(ColliderObjNum)
oz#=Object Position z(ColliderObjNum)
ny#=EyeHeight + (oy#-Intersect Object(1, ox#, oy#, oz#, ox#, -1000, oz#))
position object ColliderObjNum, ox#, ny#, oz#
if object collision(ColliderObjNum,0) <> 0
Airborn=0
EndIf
EndFunction
Function Fall()
ox#=Object Position x(ColliderObjNum)
oy#=Object Position y(ColliderObjNum)
oz#=Object Position z(ColliderObjNum)
Delta#=Gravity/Screen FPS()
ny#=EyeHeight + (oy#-Intersect Object(1, ox#, oy#, oz#, ox#, -1000, oz#))
If (oy#-ny#)<=Delta#
Position Object ColliderObjNum, ox#, ny#, oz#
Position Camera 0, ox#, ny#, oz#
Airborn = 0
Else
Position Object ColliderObjNum, ox#, oy#-delta#, oz#
Position Camera 0, ox#, oy#-delta#, oz#
EndIf
If UseReticle = 1
circle screen width()/2,screen height()/2,8
EndIf
EndFunction
This is the code for the second part of the game...
Nid help plss...