Im using DBC and im trying to use the dll to increase the Frame rate.
Here is my code
Sync On
Sync Rate 100
Autocam Off
Set Display Mode 640,480,16
Hide Mouse
CLS
Per = 0
Set Camera Range 1,10000
`Make a dummy player
Make Object Box 1,10,50,5
Position Object 1,0,20,0
set object rotation zyx 1 :`VERY IMPORTANT for rotation to work properly with collision!
setupObjectDBC(1,1,2) :`setup object 1, into group 1, with collision type sphere (1)
Hide Object 1
CLS
Per = 14.3
Text 0,0," LOADING..."+Str$(per)
Line 0,100,per,100
Sync
`Make a dummy enemy box
Load Object "IraqH-Iraq-Static.x",2
set object rotation zyx 1 :`VERY IMPORTANT for rotation to work properly with collision!
setupObjectDBC(1,1,2) :`setup object 1, into group 1, with collision type sphere (1)
Scale Object 2,2000,2000,2000
Position Object 2,Camera Position X()-500,-10,Camera Position Z()+100
CLS
Per = 28.6
Text 0,0," LOADING..."+Str$(per)
Line 0,100,per,100
Sync
`Create the hand and gun
Load Object "coltH-Colt-Static+Hand.X",3
Position Object 3,Camera Position X()+15,Camera Position Y()-10,Camera Position Z()+20
XRotate Object 3,180
ZRotate Object 3,180
Set Object Collision Off 3
Scale Object 3,75,75,75
Lock Object On 3
CLS
Per = 42.9
Text 0,0," LOADING..."+Str$(per)
Line 0,100,per,100
Sync
Load Object "Jungle 1.x",4
Scale Object 4,2000,2000,2000
Position Object 4,0,-10,0
Set Object Collision On 4
Set Object Collision To Polygons 4
Set Object 4,1,1,0
CLS
Per = 57.2
Text 0,0," LOADING..."+Str$(per)
Line 0,100,per,100
Sync
Load Object "Parfaitcielo.x",5
Scale Object 5,10000,10000,10000
Set Object Collision Off 5
XRotate Object 5,180
CLS
Per = 71.5
Text 0,0," LOADING..."+Str$(per)
Line 0,100,per,100
Sync
Per = 100
Text 0,0," LOADING..."+Str$(per)
Line 0,100,per,100
Bullet = 50
Sync
Do
Text 0,20,Str$(screen fps())
Text 0,100,Str$(Grav)
Position Object 5,Posx,Posy+500,Posz
Position Camera Object Position X(1),Object Position Y(1)+2.5,Object Position Z(1)
Posx = Object Position X(1)
Posy = Object Position Y(1)
Posz = Object Position Z(1)
Grav = 100
`Simple Bullet Counter
Text 0,0,"BULLETS LEFT: "+Str$(Bullet)
If MouseClick()=1
Text 250,250,"BANG"
Bullet = Bullet - 1
EndIf
If MouseClick()=1
If Bullet =< 1
Text 250,250,"CLICK (OUT OF AMMO PRESS SPACE TO RELOAD)"
Bullet = 0
EndIf
EndIf
If ReturnKey()=1
Bullet = Bullet + 50
Text 250,250,"RELOADED"
EndIf
if ReturnKey()=1
CLS
If Bullet => 49
Text 250,250,"GUN CAN ONLY HOLD 50 BULLETS"
Bullet = 50
EndIf
EndIf
`Control With Keyboard and mouse
If UpKey()=1 Then Move Object 1,4
If DownKey()=1 Then Move Object 1,-4
cx#=wrapvalue(cx#+mousemovey())
cy#=wrapvalue(cy#+mousemovex())
cz#=wrapvalue(cz#+mousemovez())
Rotate Object 1,0,cy#,cz#
Rotate Camera cx#,cy#,cz#
`Detect collision with an Object and Slide
`If Object Hit(1,4)>0
`Inc Posy,10
`Position Object 1,Posx,Posy,Posz
`Endif
`If Object Collision(1,4)<4
`Dec Posy,1
`Position Object 1,Posx,Posy,Posz
`EndIf
`If Object Collision(1,0)>0
`Position Object 1,Posx,Posy,Posz
`EndIf
collide=intersectObjectDBC(1,1,oldx#,oldy#,oldz#,x#,y#,z#,0)
if collide<>0
newx#=getStaticCollisionX()
newy#=getStaticCollisionY()
newz#=getStaticCollisionZ()
normx#=getCollisionNormalX()
normy#=getCollisionNormalY()
normz#=getCollisionNormalZ()
position object counter,newx#+normx#/10.0,newy#+normy#/10.0,newz#+normz#/10.0
point object counter,newx#+normx#,newy#+normy#,newz#+normz#
show object counter
counter = counter + 1
if counter>10040 then counter = 10002
endif
But the guy still goes through everything! Can someone help me use this DLL Properly!
Edit:
Oh yeah if I can get collision working with a good frame rate I can release a demo!
DRAGONFIRE STUDIOS
Lead Programmer
(The Studio being my front room)