ok here is my code i have put yours in and i think i'm meant to add something somewhere not sure where.
sorry for the questions just not sure what the hell to do atm i have had dbpro for about 2 days. This code returns a error of
"user function Playagain must return a value if used in an expression at line 72"
rem HIDE THE MOUSE AND LIMIT THE SYNC RATE TO 40
hide mouse:sync rate 40
rem MAKE THE PADDLES, BALL AND FLOOR
make object box 1,0.5,0.5,3:color object 1,rgb(255,0,0)
make object box 2,0.5,0.5,3:color object 2,rgb(0,255,0)
make object sphere 3,0.5:color object 3,rgb(0,0,50)
make object box 4,10,0.1,10:position object 4,0,-0.55,0
rem SET THE BALL ANGLE TO 90 DEGREES
balla#=90
rem START THE MAIN LOOP
repeat
do
rem SCORING
IF ballx#>6
player2score#=player2score#+1
ballx#=0
ballz#=0
balla#=270
wait 1000
ENDIF
IF ballx#<-6
player1score#=player1score#+1
ballx#=0
ballz#=0
balla#=90
wait 1000
ENDIF
set cursor 300,50:print player2score#
set cursor 320,50:print "-"
set cursor 340,50:print player1score#
rem you win or lose
sync
IF player1score#=5 and player2score#<5
Center Text Screen Width() * 0.5 , Screen Height() * 0.5 ,"YOU WIN!"
ENDIF
IF player1score#<5 and player2score#=5
Center Text Screen Width() * 0.5 , Screen Height() * 0.5 ,"YOU LOSE"
ENDIF
rem BALL MOVEMENT
ballx#=newxvalue(ballx#,balla#,0.3):ballz#=newzvalue(ballz#,balla#,0.3)
rem PLAYER 1 PADDLE MOVEMENT
IF upkey()=1 and player1pos#<3.5 then player1pos#=player1pos#+0.5
IF downkey()=1 and player1pos#>-3.5 then player1pos#=player1pos#-0.5
IF upkey()=1 and ballx#>4 and ballx#<4.5 then balla#=balla#+8
IF downkey()=1 and ballx#>4 and ballx#<4.5 then balla#=balla#-8
rem PLAYER 2 PADDLE MOVEMENT AI
IF ballz#>player2pos# then player2pos#=player2pos#+0.1
IF ballz#<player2pos# then player2pos#=player2pos#-0.1
rem BOUNCING
IF ballx#>4 and ballx#<4.5 and ABS(player1pos#-ballz#)<1.5 then balla#=360-balla#
IF ballx#<-4 and ballx#>-4.5 and ABS(player2pos#-ballz#)<1.5 then balla#=360-balla#
IF ballz#>4 or ballz#<-4 then balla#=180-balla#
rem MAKE SURE balla# IS LESS THAN 360 AND MORE THAN 0
balla#=wrapvalue(balla#)
rem POSITION OBJECTS
position object 1,5,0,player1pos#:position object 2,-5,0,player2pos#
position object 3,ballx#,0,ballz#:yrotate object 3,balla#
position camera 0,10,-10:point camera 0,0,0
sync
loop
until NOT Playagain()
END
function Playagain()
do
center text 400,300, "Play Again? (Y/N)
if upper$(inkey$()) = "Y"
exitfunction 1
endif
if upper$(inkey$()) = "N"
exitfunction 0
endif
sync
loop
EndFunction