Hey all,
I'm back.
Here, I have recreated an example:
Rem Project: -Three-ControlDevicesThatFire
Rem Created: 22/5/2010 16:25:58
rem simple program to demonstrate using THREE controllers
rem for movement and firing
rem Init app
sync on : sync rate 60
rem Detect second controller (joystick autoselects first one)
perform checklist for control devices
if checklist quantity()>1
set control device index 1
set control device checklist string$(1)
endif
rem Position players
dim x(3) : x(1)=200 : x(2)=440 : x(3)=400
dim y(3) : y(1)=200 : y(2)=200 : y(3)=140
dim s(3) : s(1)=0 : s(2)=0 : s(3)=0
rem Main loop
do
`
rem Move players and detect fire buttons
for i=1 to checklist quantity()
set control device index i-1
x(i)=x(i)+(joystick x()/900)
y(i)=y(i)+(joystick y()/900)
for n=1 to 32 : if joystick fire x(n)=1 : s(i)=n : endif : next n
next i
`
rem Keep players in screen
for n=1 to 3
if x(n)<0 then x(n)=0
if y(n)<0 then y(n)=0
if x(n)>640 then x(n)=640
if y(n)>480 then y(n)=480
next n
`
rem Draw players
cls 0
Print Screen Fps()
ink rgb(255,0,0),0 : circle x(1),y(1),9+(s(1)*3) : center text x(1),y(1)-6,str$(s(1))
ink rgb(0,255,0),0 : circle x(2),y(2),9+(s(2)*3) : center text x(2),y(2)-6,str$(s(2))
ink rgb(0,0,255),0 : circle x(3),y(3),9+(s(3)*3) : center text x(3),y(3)-6,str$(s(3))
`
rem User prompt
ink rgb(255,255,0),0
if checklist quantity()<2
center text 320,20,"ONLY ONE CONTROLLER DETECTED"
else
center text 320,20,checklist string$(1)+" AND "+checklist string$(2) ` +" AND "+checklist string$(3)
endif
`
rem Update screen
sync
`
rem End loop
loop
Everything works fine with two controllers, but controller three wont register. Why is this, I thought that DBPRO now supports up to 8 Joysticks......?