Handbook
Glossary
?bounce-off-paddle ( BALL GADGET PADDLE -- )
Vocabulary
pong
Inputs
BALL
an
object
GADGET
an
object
PADDLE
an
object
Outputs
None
Definition
USING:
accessors
kernel
math
math.order
sequences
timers
;
IN:
pong
::
?bounce-off-paddle
( BALL GADGET PADDLE -- )
BALL
pos>>
first
dup
BALL-SIZE
+
PADDLE
dup
PADDLE-SIZE
+
[
between?
]
2curry
either?
[
BALL PADDLE
bounce-off-paddle
]
[
GADGET
t
>>game-over?
timer>>
stop-timer
]
if
;