I use DBP, but I will still try to help. I will edit this message as I find more.
Haven't found the problem yet, but you aren't supposed to put sync on in the loop. You are supposed to do this outside of the loop and then sync in the loop
Edit-----
Solved. You had one if inside another when it shouldn't have been. This works (for DBPro at least)
` Tennis
` set variables (positions,score)
player1Xpos# = 11
player1Zpos# = 0
player2Xpos# = -11
player2Zpos# = 0
ballA# = 90
ballXpos# = 0
ballZpos# = 0
` create objects (bats,walls,ball)
MAKE OBJECT SPHERE 1,1:COLOR OBJECT 1,RGB(0,0,0): ` ball
MAKE OBJECT BOX 2,1,1,3:COLOR OBJECT 2,RGB(0,255,0): ` player 1 bat
MAKE OBJECT BOX 3,1,1,3:COLOR OBJECT 3,RGB(255,0,0): ` player 2 bat
MAKE OBJECT BOX 4,25,1,30:COLOR OBJECT 4,RGB(255,255,255): ` floor
MAKE OBJECT BOX 5,1,1,3:COLOR OBJECT 5,RGB(200,0,255): ` wall
MAKE OBJECT BOX 6,1,1,3:COLOR OBJECT 6,RGB(200,0,255): ` wall
MAKE OBJECT BOX 7,1,1,3:COLOR OBJECT 7,RGB(200,0,255): ` wall
` position objects(floor and walls)
POSITION OBJECT 4,0,-1,0
POSITION OBJECT 5,0,0,0
POSITION OBJECT 6,0,0,10
POSITION OBJECT 7,0,0,-10
` position and aim camera
POSITION CAMERA 0,40,0
POINT CAMERA 0,0,0
` hide the mouse
HIDE MOUSE
SET GLOBAL COLLISION ON
sync on
sync rate 30
DO
sync
` position bats
POSITION OBJECT 2,player1Xpos#,0,player1Zpos#
POSITION OBJECT 3,player2Xpos#,0,player2Zpos#
` position ball
POSITION OBJECT 1,ballXpos#,0,ballZpos#
` set ball movement
YROTATE OBJECT 1,ballA#
ballXpos# = newXvalue(ballXpos#,ballA#,0.4)
ballZpos# = newZvalue(ballYpos#,ballA#,0.4)
` ball collision
IF OBJECT HIT(1,2) = 1
ballA# = 360 - ballA#
Endif
IF OBJECT HIT(1,3) = 1
ballA# = 360 - ballA#
ENDIF
LOOP
Edit----
After studying your code some more I wonder why you
"set global collision on". You don't need this (at least with DBP)