Handbook
Glossary
bounce-off-paddle ( BALL PADDLE -- )
Vocabulary
pong
Inputs
BALL
an
object
PADDLE
an
object
Outputs
None
Definition
USING:
accessors
arrays
math
math.order
sequences
;
IN:
pong
::
bounce-off-paddle
( BALL PADDLE -- )
BALL
pos>>
first
BALL-SIZE
2
/
+
PADDLE
PADDLE-SIZE
2
/
+
-
1/4
*
BALL
vel>>
second
neg
BOUNCE
*
MAX-SPEED
min
2array
BALL
vel<<
;