12-17-2005, 02:58 AM
Code:
Screen 18,,,1 : Cls
points = 0
Goto begin:
start:
Cls
Line (0,playery)-(10,playery+50), 15,bf
inputsec:
a$ = Inkey$
If a$ = "w" And playery > 0 Then playery-=20
If a$ = "s" And playery < (479-50) Then playery+=20
If a$ = Chr$(27) Then End
Goto ball
ball:
ballx+=ballxvel : bally += ballyvel
Circle (ballx+10, bally+10), 10
Goto collision
endloop:
Locate 1, 35: Print points
Sleep 16 : Goto start
begin:
playery=0
ballx= 10 : bally = 10
ballxvel=5 : ballyvel = 5
Goto start
collision:
If ballx <= 0 Then Goto begin
If ballx <= 10 And bally > playery And bally < playery+50 Then
ballxvel = -ballxvel
points+=1
End If
If bally <= 0 Then ballyvel = -ballyvel
If ballx >= 639 Then ballxvel =-ballxvel
If bally >= 479 Then ballyvel = -ballyvel
Goto endloop
Bounce the ball off the wall. Each time you bounce the ball off the paddle, you get a point. Use the lower-case 'w' and 'a' keys to move the paddle up and down. Took me about half an hour to write.
.14159265358979323846264338327950288419716939937510582709445
Glarplesnarkleflibbertygibbertygarbethparkentalelelangathaffendoinkadonkeydingdonkaspamahedron.
Glarplesnarkleflibbertygibbertygarbethparkentalelelangathaffendoinkadonkeydingdonkaspamahedron.