I need help with my engine. I have included the source so you can see what i am doing.
I want the camera to have collision with objects and move around/jumping when noclip=0.
That would be great if someone could please help me.
You cannot use any of my engine for your own project unless you help me with this or have my permission.
I will be very greatful if someone helps.
REMSTART
Project Name=Phy-Play
Project Developer=Rad-x Entertainment
Project Start Date=11/8/09 4:46pm
REMEND
REMSTART
`Object number library
1=skybox 1
2=terrain grassyhill
REMEND
`Initialise main attributes
sc_w=800:sc_h=600
set display mode sc_w,sc_h,32,1
sync on : sync rate 60
color backdrop rgb(0,0,140)
backdrop on
phy start
PHY SET FIXED TIMING 5.0/90
position light 0,-3146,3141,196
set light range 0,99999
set text font "Verdana"
set text size 15
set text to bold
ink rgb(255,0,0,),0
`Setup variables
noclip=0
noclip_speed=2
debug=0
menu=0
level=1
`Setup main camera
autocam off
`position camera 20,351,100
set camera range 1,1000000
set camera fov 70
`Setup skybox
load object "media/skybox/ngt/ngt.x",1
set object light 1,0
scale object 1,300000,350000,300000
set object texture 1,2,1
set object cull 1,0
`Load all textures ALL .PNG FILES!
load image "media/textures/bg_crosshair.png",1
load image "media/textures/bg_detail.png",2
load image "media/textures/bg_dirt1.png",3
load image "media/textures/bg_map1.png",4
load image "media/textures/bg_map1tex.png",5
load image "media/textures/bg_rockcolor.png",6
load image "media/textures/bg_smoke.png",7
`Load music
load music "media/sounds/back_music1.mp3",1
`Make Grassyhill Level
make object terrain 2
set terrain heightmap 2,"media/textures/bg_map1.png"
set terrain scale 2,22.535,3.5,22.535
set terrain split 2,16
set terrain tiling 2,4
set terrain light 2,1,-0.25,0,1,1,0.78,0.5
set terrain texture 2,5,2
`if level=grassyhill level
build terrain 2
position object 2,-2500,0,-2500
phy make rigid body static terrain 2
`make test box
a=3
make object cube a,30
position object a,307,284,174
`scale object a,30,30,30
phy make rigid body dynamic box a
texture object a,6
set shadow shading on a,-1,800,1
`Show the crosshair
sprite 1,screen width()/2-16,screen height()/2-16,1
SET SPRITE ALPHA 1,100
` create our box controller
make object box 4, 20, 50, 20
`position object 4,20,351,100
phy make box character controller 4, 434, 42, -517, 10, 35, 10, 1, 10.5, 45.0
hide object 4
`Start main events
DO
`Rotate sky
yrotate object 1,object angle y(1)+0.01
`Setup debug mode
if keystate(74)=1
debug=1
endif
if keystate(78)=1
debug=0
endif
`change to and from noclip
if debug=1
if keystate(47)=1
noclip=1
endif
if keystate(47)=0
noclip=0
endif
endif
`change noclip speed if press shift
if keystate(42)=1
noclip_speed=9
endif
if keystate(42)=0
noclip_speed=2
endif
`Control Camera noclip
if noclip=1
cr#=0:cf#=0
if rightkey()=1 or KEYSTATE(32)=1 then cr#=-noclip_speed
if leftkey()=1 or KEYSTATE(30)=1 then cr#=noclip_speed
if upkey()=1 or KEYSTATE(17)=1 then cf#=noclip_speed
if downkey()=1 or KEYSTATE(31)=1 then cf#=-noclip_speed
ncr#=curvevalue(cr#,ncr#,5)
ncf#=curvevalue(cf#,ncf#,5)
cx#=cx#+mousemovey()*0.2
cy#=cy#+mousemovex()*0.2
if cx#>80 then cx#=80
if cx#<-80 then cx#=-80
ncx#=curveangle(cx#,ncx#,2)
ncy#=curveangle(cy#,ncy#,2)
move camera ncf#
rotate camera 0,wrapvalue(ncy#-90),0
move camera ncr#
rotate camera 0,wrapvalue(ncy#+90),0
rotate camera ncx#,ncy#,0
phy set rigid body position 4,camera position x(0),camera position y(0),camera position z(0)
endif
[b]`control character normal
if noclip=0
cr#=0:cf#=0
if upkey()=1 or keystate(17)=1 then phy move character controller 3, 200.0
ncr#=curvevalue(cr#,ncr#,5)
ncf#=curvevalue(cf#,ncf#,5)
cx#=cx#+mousemovey()*0.2
cy#=cy#+mousemovex()*0.2
if cx#>80 then cx#=80
if cx#<-80 then cx#=-80
ncx#=curveangle(cx#,ncx#,2)
ncy#=curveangle(cy#,ncy#,2)
move camera ncf#
rotate camera 0,wrapvalue(ncy#-90),0
move camera ncr#
rotate camera 0,wrapvalue(ncy#+90),0
rotate camera ncx#,ncy#,0
position camera object position x(4),object position y(4),object position z(4)[/b]
`destroy sphere round nocliped player
`PHY SET RIGID BODY POSITION 4,99999,99999,99999
endif
if menu=0
position mouse screen width()/2,screen height()/2
hide mouse
endif
`Position sky box to camera
position object 1,camera position x(0),camera position y(0)+100,camera position z(0)
`setup debug mod visuals
if debug=1
print "cam x angle(up down): "+str$(camera angle x(0))
print "cam y angle: "+str$(camera angle y(0))
print "cam x pos: "+str$(camera position x(0))
print "cam y pos(up down): "+str$(camera position y(0))
print "cam z pos: "+str$(camera position z(0))
print "FPS:"+str$(screen fps())
print "Noclip="+str$(noclip)
endif
loop music 1
PHY UPDATE
SYNC
LOOP
The part I need help with is in bold
Hey people. Im new to dark basic professional and dark physics. Please help me if you can