I made a pong game from the "My First Pong Game" tutorial but changed it alot to make it full screen. The problem is the ball bounces whenever the pads are moving even if it doesn't hit the pads, eg if you just hold up and the ball hits the bottom left on the screen it will still bounce off as if it hit a pad.
This is my full code:
hide mouse
color backdrop rgb (0,0,0)
rem MAKE THE PADDLES AND BALL
make object box 1,1,1,6:color object 1,rgb(255,255,255)
make object box 2,1,1,6:color object 2,rgb(255,255,255)
make object sphere 3,1.5:color object 3,rgb(255,255,255)
rem SET THE BALL ANGLE
balla#=250
rem START THE MAIN LOOP
do
rem BALL MOVEMENT
ballx#=newxvalue(ballx#,balla#,0.04):ballz#=newzvalue(ballz#,balla#,0.04)
rem PLAYER 1 PADDLE MOVEMENT
IF upkey()=1 AND player1pos#<8.5 then player1pos#=player1pos#+0.02
IF downkey()=1 AND player1pos#>-8.5 then player1pos#=player1pos#-0.02
if upkey()=1 and ballx#<-14 and ballx#>-14.5 then balla#=balla#+17
if downkey()=1 and ballx#<-14 and ballx#>-14.5 then balla#=balla#-17
rem PLAYER 2 PADDLE MOVEMENT
IF keystate(17)=1 AND player2pos#<8 then player2pos#=player2pos#+0.02
IF keystate(31)=1 AND player2pos#>-8 then player2pos#=player2pos#-0.02
if keystate(17)=1 and ballx#>14 and ballx#<14.5 then balla#=balla#+15
if keystate(31)=1 and ballx#>14 and ballx#<14.5 then balla#=balla#-15
rem BOUNCING
if ballx#<-14 and ballx#>-14.5 and ABS(player1pos#-ballz#)<1.5 then balla#=360-balla#
if ballx#>14 and ballx#<14.5 and ABS(player2pos#-ballz#)<1.5 then balla#=360-balla#
if ballz#>11.5 or ballz#<-11.5 then balla#=180-balla#
balla#=wrapvalue(balla#)
rem SCORING
if ballx#>16 then player1score#=player1score#+1:ballx#=10:ballz#=10:balla#=250
if ballx#<-16 then player2score#=player2score#+1:ballx#=-10:ballz#=10:balla#=110
set cursor 300,50:print player1score#
set cursor 320,50:print "-"
set cursor 340,50:print player2score#
rem POSITION OBJECTS
position object 1,-15,0,player1pos#:position object 2,15,0,player2pos#
position object 3,ballx#,0,ballz#:yrotate object 3,balla#
position camera 0,20.5,0:point camera 0,0,0
loop
Does anyone know how i can fix it so the ball will only bounce of the pads.