Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Obscurely coded pong
#7
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.
Reply


Messages In This Thread
Obscurely coded pong - by Zack - 12-16-2005, 09:25 AM
Obscurely coded pong - by Zap - 12-16-2005, 04:33 PM
Obscurely coded pong - by yetifoot - 12-16-2005, 05:59 PM
Obscurely coded pong - by Anonymous - 12-16-2005, 07:24 PM
Obscurely coded pong - by Zack - 12-16-2005, 11:53 PM
Obscurely coded pong - by yetifoot - 12-17-2005, 12:30 AM
Obscurely coded pong - by thegrogen - 12-17-2005, 02:58 AM
Re: Obscurely coded pong - by NecrosIhsan - 12-17-2005, 03:42 AM
Obscurely coded pong - by yetifoot - 12-17-2005, 05:11 AM
Obscurely coded pong - by KiZ - 12-17-2005, 08:04 AM
Obscurely coded pong - by yetifoot - 12-17-2005, 04:42 PM
Obscurely coded pong - by jupiter3888 - 12-17-2005, 06:48 PM
Obscurely coded pong - by NecrosIhsan - 12-17-2005, 08:51 PM
Obscurely coded pong - by thegrogen - 12-17-2005, 10:13 PM
Obscurely coded pong - by axipher - 12-17-2005, 11:50 PM
Obscurely coded pong - by stylin - 12-18-2005, 12:15 AM
Obscurely coded pong - by axipher - 12-18-2005, 01:05 AM
Obscurely coded pong - by Anonymous - 12-18-2005, 02:53 AM
Obscurely coded pong - by stylin - 12-18-2005, 03:21 AM
Obscurely coded pong - by yetifoot - 12-18-2005, 03:28 AM
Obscurely coded pong - by Z!re - 12-18-2005, 04:34 AM
Obscurely coded pong - by Deleter - 12-18-2005, 05:20 AM
Obscurely coded pong - by KiZ - 12-18-2005, 11:17 PM
Obscurely coded pong - by Zack - 12-18-2005, 11:52 PM
Obscurely coded pong - by axipher - 12-19-2005, 12:13 AM
Obscurely coded pong - by whitetiger0990 - 12-19-2005, 01:03 AM
Obscurely coded pong - by axipher - 12-19-2005, 01:10 AM
Obscurely coded pong - by KiZ - 12-19-2005, 01:18 AM
Obscurely coded pong - by Deleter - 12-19-2005, 01:39 AM
Obscurely coded pong - by axipher - 12-19-2005, 02:00 AM
Obscurely coded pong - by yetifoot - 12-19-2005, 04:37 AM
Obscurely coded pong - by Deleter - 12-19-2005, 04:37 AM
Obscurely coded pong - by axipher - 12-19-2005, 06:12 AM
Obscurely coded pong - by Deleter - 12-22-2005, 03:45 AM
Obscurely coded pong - by axipher - 12-22-2005, 07:18 AM
Obscurely coded pong - by KiZ - 12-22-2005, 08:32 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)