home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Sauce 'n' Code 3
/
sauce-n-code-03.adf
/
Source_Code
/
Bounce_Ball.asc
< prev
next >
Wrap
Text File
|
1996-01-21
|
1KB
|
44 lines
'---------------------------------------------------------------------------
' BOUNCING BALL EFFECT BY JOHN HARDIE (JOK/NFA)
'---------------------------------------------------------------------------
'
'
BS=160 : Rem ****SIZE OF BALL
'
Screen Open 0,360,300,2,0
Screen Display 0,,20,,
Flash Off : Curs Off : Hide : Cls 0
'
Circle BS/2,BS/2,BS/2-4 : Paint BS/2,BS/2
Get Bob 1,0,0 To BS,BS
Colour 1,$FFF : Cls 0
For A=1 To 500 : Plot Rnd(400),Rnd(400) : Next A
Locate 0,10 : Centre "BOUNCING (BOB) BALL"
Double Buffer
'---------------------------------------------------------------------------
'
Y#=240
C#=1
S=1 : Rem ***** SPEED OF BALL
'
Do
Bob 1,X,Y#,1
'
A#=A#+1.21 : Y#=Y#+A#
Add X,S
'
If X>=350-BS : S=-Rnd(16)+1 : End If
If X<0 : S=Rnd(16)+1 : End If
If Y Bob(1)>300-BS : Y#=300-BS : A#=-20 : C#=C#+1 : End If
If A#<=-C# : A#=-C# : End If
If A#>=C# : A#=C# : End If
If Mouse Key : Erase 1 : Edit : End If
'
Wait Vbl
Loop