Here is code:
hide mouse
sync rate 0
sync on
`draw ball
ink rgb(255,0,0),0
box 0,0,15,15
get image 1,0,0,15,15
cls 0
`draw paddle
ink rgb(0,200,255),0
box 0,0,164,20
get image 2,0,0,164,20
cls 0
speedx=4
speedy=4
ballx=300
bally=435
player1x=230
player1y= 450
score1=0
spacekey=0
serve1=1
lives=5
do
cls 0
paste image 1,ballx,bally
paste image 2,player1x,player1y
` write scores on screen
set text font "Arial"
set text size 20
text 10,0,"Player One: " + str$(score1)
text 560,0,"Lives : " + str$(lives)
`make the ball move
if spacekey=1 then inc ballx,speedx : dec bally,speedy
if keystate(57)=1 and spacekey=0 then inc ballx,speedx : inc bally,speedy*-1 : spacekey=1
`Controls for moving the paddle
if leftkey()=1 then dec player1x,2 : if player1x<0 then player1x=0
if rightkey()=1 then inc player1x,2 : if player1x>620 then player1x=620
`Walls rebounds
if ballx>620 then speedx=speedx*-1
if bally<20 then speedy=speedy*-1
if ballx<8 then speedx=speedx+1
if bally>478 then lives=lives-1
`If player misses ball
if bally>478 then gosub resetgame
`Write game over when lives equal 0
if lives=0 then set cursor 270, 80 : print "Game Over" : suspend for key : end
sync
loop
`reset sub
resetgame:
spacekey=0
if serve1=1
speedx=4
speedy=4
ballx=300
bally=435
player1x=230
player1y=450
endif
return