Ok, now that I got it working with the tutorials I tried it with my movement and jumping code I had done before, but I can't seem to get it to work. I followed their examples closely, and made sure that everything they did in their sample projects that needed to be done was in fact included in my code... but when I try to compile the screen pops up and then quickly closes again....
Here's the code:
sync on:sync rate 60
Set Window On
SET DISPLAY MODE 800, 600, 16
make object sphere 1, 2
position object 1, 0, 0, 50
make object collision box 1, -1.2, -1.2, -1.2, 1.2, 1.2, 1.2, 0
make object box 2, 4, 2, 4
position object 2, 6, 0, 0
make object collision box 2, -2, -0.5, -2, 2, 0.5, 2, 0
make object box 3, 50, 0.5, 10
position object 3, 0, -1.2, 0
REM All the pretty variables
global speedr#
global speedl#
global posx#
global posy#
global posz#
global jumpy#
global jumped
global a#=0.3
REM Nuclear Glory Stuff
#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
#Constant TYPE_SPH_OBJ=1
#Constant TYPE_BLOCK_ONE=2
#Constant TYPE_FLOOR_BOX=3
StartCollisionPRO(000000000,000000000,000000000)
StartCollisionDebugPRO()
CollisionTypePro( 1, TYPE_SPH_OBJ )
CollisionTypePro( 2, TYPE_BLOCK_ONE )
CollisionTypePro( 3, TYPE_FLOOR_BOX )
SetObjRadiusPRO( 1, 2, 2, 2 )
SetCollisionsPRO( TYPE_SPH_OBJ, TYPE_FLOOR_BOX, ELLIP_2_ELLIP, RESP_SLIDE_NO_GRAV, DYN_NO_RESP, 0 )
SetCollisionsPRO( TYPE_SPH_OBJ, TYPE_BLOCK_ONE, ELLIP_2_ELLIP, RESP_SLIDE, DYN_NO_RESP, 0 )
SetCollisionExclusive( 1 )
do
REM make camera follow character
position camera posx#, 0,-20
keyctrl()
print "right speed: ", speedr#
print "left speed: ", speedl#
position object 1,posx#,posy#,posz#
RunCollisionPRO()
posx#=object position x(1)
posz#=object position z(1)
posy#=object position y(1)
sync
loop
REM Controls
function keyctrl()
REM move and rotate right
if rightkey()=1
speedr#=speedr#+.003
else
speedr#=speedr#-.003
endif
REM move and rotate left
if leftkey()=1
speedl#=speedl#+.003
else
speedl#=speedl#-.003
endif
REM jumping
if spacekey()=1 and jumped=0
jumped=1
a#=0.3
endif
if jumped=1
jumpy#=object position y(1)+a#
a#=a#-0.01
endif
REM limit speed
if speedr#=>0.3 then speedr#=0.3
if speedl#=>0.3 then speedl#=0.3
if speedr#=<0.0
speedr#=0.0
endif
if speedl#=<0.0
speedl#=0.0
endif
position object 1,posx#+speedr#-speedl#,jumpy#,0
endfunction
I am not sure what it is thats stopping the program from running... but when I remove the CollisionTypePRO commands...
CollisionTypePro( 1, TYPE_SPH_OBJ )
CollisionTypePro( 2, TYPE_BLOCK_ONE )
CollisionTypePro( 3, TYPE_FLOOR_BOX )
... the program displays fine, but the object stays stationary...
Hmmm
Neeeeeeeewom!