Hi
I use Nuclear glory(The latest version) to a game im making.
Since the collision with dbpro and x files is dodgy i would like to learn something about the raycast system so i can get good collision detections for my game. The problem is that i can get a collision detection with my player object if im not even hit a an object.
So if someone would like to help me then please i really need it
Here is the code i use for my game so far:
Rem ***** Main Source File *****
`The normal settings
sync on
sync rate 30
hide mouse
`Start the collision system
startcollisionPRO(734385167,281152624,124454926)
`Start the collision debugger
startcollisiondebugPRO()
`set the exclusive to 0
setcollisionexclusive( 0 )
`The constants
#Constant NCULL_COUNTER_CLOCK 1
#Constant NCULL_CLOCK 2
#Constant NCULL_NONE 3
#Constant TYPE_NGC_ELLIP=1
#Constant TYPE_NGC_MESH=2
#Constant ELLIP_2_ELLIP=1
#Constant ELLIP_2_POLY=2
#Constant RESP_STICK=1
#Constant RESP_SLIDE=2
#Constant RESP_SLIDE_NO_SLOPES=3
#Constant RESP_SLIDE_NO_GRAV=4
#Constant RESP_SLIDE_NO_ACCEL=5
#Constant RESP_NONE=6
#Constant DYN_NO_RESP=1
#Constant DYN_RESP=2
#Constant DYN_RESP_NOTURN=3
` My own constants
#constant type_player = 2
#constant type_map = 1
rem This is the collision types
SetCollisionsPRO(Type_Player, Type_map, ELLIP_2_POLY, RESP_SLIDE, DYN_NO_RESP,Auto_Priority )
`Load the playground and set the collisiontype
load object "media/playground.x",1
collisiontypePRO( 1, type_map )
position object 1,0,-3000,0
`The player object and set the collisiontype
make object sphere 2,10
collisiontypePRO( 2, type_player )
color object 2,RGB(128,0,128)
`position the player object on top of the builiding(playground)
position object 2, 0,40,0
rem set object collision radius
SetObjRadiusPRO(2,object size x(2)/2,object size y(2)/2,object size z(2)/2)
`set the object gravity on the player object
SetObjGravityPRO( 2, 1 )
`The main loop
do
`collisions
if object collision(1,2)
print "COLLISION DETECTION"
endif
`print the frames per second
set cursor 0,0
print "Frames per second : "; screen fps()
`The player control input
if upkey() = 1
move object 2,3
endif
if downkey() = 1
move object 2,-3
endif
if leftkey() = 1
turn object left 2,3
endif
if rightkey() = 1
turn object right 2,3
endif
runcollisionPRO()
set camera to follow object position x(2),object position y(2),object position z(2),0,100,100,10,0
point camera object position x(2),object position y(2),object position z(2)
sync
loop
Thanks
The Nerd