Posted: 18th Mar 2005 05:41
With the camera working, I put my time into collisions, think I've read most if not all the past posts on the topic, even raided the code base,Want to see what you guys find in the code
Rem Project: Shooting_range
Rem Created: 3/15/2005 11:15:09 PM
Rem ***** Main Source File *****
backdrop off : hide mouse
rem Setup camera
set camera range 1,10000
load object "shooting_range.x",1
scale object 1,200,200,200
set object collision to polygons 1
disable object zdepth 1
load object "sky_box.3ds",2
Make Object Sphere 5, .1
`set up its collision method
Set Object Collision to polygons 5
set ambient light 55
position camera 0,0,4,-8
cpx#= camera position x()
cpz#= camera position z()
cpy#= camera position y()
cmx#=1
cmz#=-5
a#=0
b#=0
f=100
set global collision on
do
position object 5,cpx#,cpy#,cpz#
col=object collision (1,5)
if col<>0 then print "HIT!!!!!!!!"
rem Create simple sprite based crosshair
sprite 1,512,384,1
set sprite 1,0,1
size sprite 1,25,1
offset sprite 1,12.5,0
sprite 2,512,384,1
set sprite 2,0,1
size sprite 2,1,25
offset sprite 2,0,12.5
camSpeed#=.05
cam_x# = CAMERA ANGLE X() + MOUSEMOVEY() * .5
cam_y# = CAMERA ANGLE Y() + MOUSEMOVEX() * .5
cam_z# = CAMERA ANGLE Z() + MOUSEMOVEZ() * .5
IF INKEY$() = "w"
MOVE CAMERA CamSpeed#
XROTATE CAMERA cam_x#
ENDIF
IF INKEY$() = "s"
MOVE CAMERA CamSpeed#*-1
XROTATE CAMERA cam_x#
ENDIF
IF INKEY$() = "a"
ROTATE CAMERA 0, cam_y#-90, 0
MOVE CAMERA CamSpeed#
ROTATE CAMERA cam_x#, cam_y#, 0
ENDIF
IF INKEY$() = "d"
ROTATE CAMERA 0, cam_y#+90, 0
MOVE CAMERA CamSpeed#
ROTATE CAMERA cam_x#, cam_y#, 0
ENDIF
if cam_x#>50 then cam_x#=50
if cam_x#<-50 then cam_x#=-50
ROTATE CAMERA cam_x#, cam_y#, cam_z#
position camera cpx#,cpy#-0.001,cpz#
sync
loop
when it starts up the camera seems to be stuck in the ground, it will rotate, but I can not move. I've stuck a " if col<>0 then print "hit!!!" to list a collision, but none are detected, Thanks again m8tes!
hope I have the 's right