Hi,
Could someone tell me what im doing wrong with this code?
Problem:
The collision system slows down the program DRAMATICALLY!!!!
and thats it - i must be doing something wrong
`-----------`
DECLARATIONS:
`-----------`
camX# = 0.1999
camY# = -1.0
camZ# = 2.5
ball = 1
table = 2
`--------`
FUNCTIONS:
`--------`
makeObjects()
loadObjects()
rem globals
#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
StartCollisionPRO(xxxx,xxxx,xxxx)
`StartCollisionDebugPRO()
rem The collision type ID of our collision object
#Constant TYPE_SPHERE = 1
#Constant TYPE_POLY = 2
rem A collision definition for sphere to sphere collision
SetCollisionsPro( TYPE_SPHERE, TYPE_POLY, ELLIP_2_POLY, RESP_SLIDE, DYN_NO_RESP, 0 )
CollisionTypePRO( 1, TYPE_SPHERE )
CollisionTypePRO( 2, TYPE_POLY )
`---`
MAIN:
`---`
do
if keystate(200) = 1 then inc camY#, .1
if keystate(208) = 1 then dec camY#, .1
if keystate(205) = 1 then inc camX#, .1
if keystate(203) = 1 then dec camX#, .1
if keystate(30) = 1 then inc camZ#, .1
if keystate(44) = 1 then dec camZ#, .1
position object 1, camX#, camY#, camZ#
dec camZ#, .01
set cursor 0, 0
print "camX#: ", camX#
print "camY#: ", camY#
print "camZ#: ", camZ#
rem And here's the best line! This commands runs the entire collision system
rem and updates all of your objects for you. Easy enough?
RunCollisionPRO()
sync
loop
wait key
function makeObjects()
make object sphere 1, 0.2
position object 1, 0.1999, -1.0, 2.5
make camera 1
position camera 1, camX#, camY#, camZ#
endfunction
function loadObjects()
load object "mediatable.x", 2
yrotate object 2, 90
position object 2, 0, -1.25, 0.8999
endfunction
Cheers
Stew
[Mod Edit - Jess T]
Be careful posting your NGC key in the source code!
I've edited it out, but be more careful next time

[/Edit]
mash it up 'arry