Handbook
Glossary
move-ball ( GADGET -- )
Vocabulary
pong
Inputs
GADGET
an
object
Outputs
None
Definition
USING:
accessors
kernel
math
math.order
math.vectors
sequences
;
IN:
pong
::
move-ball
( GADGET -- )
GADGET
ball>>
:>
BALL BALL
vel>>
first
dup
0
>
380 10
?
BALL
pos>>
first
-
swap
/
1
min
BALL
vel>>
second
dup
0
>
380 10
?
BALL
pos>>
second
-
swap
/
1
min
min
:>
movement movement 0
>
[
movement
throw
]
unless
BALL
pos>>
BALL
vel>>
movement
v*n
v+
BALL
pos<<
;