LOOKUP TX2FORTH NOT ?ABORT" Must run with TX2FORTH."

SRC" PLASMA.4TH"
SRC" CONIO.4TH"
SRC" DGRLIB.4TH"

 5 VARIABLE BALLCLR
10 VARIABLE BALLX
20 VARIABLE BALLY
 1 VARIABLE INCX
 1 VARIABLE INCY

: BEEP 30 10 TONE ;

: BOOP 10 30 TONE ;

: MOVEBALL
  BALLX @ 0=   IF INCX @ NEGATE INCX ! BEEP THEN
  BALLX @ 79 = IF INCX @ NEGATE INCX ! BEEP THEN
  BALLY @ 0=   IF INCY @ NEGATE INCY ! BOOP THEN
  BALLY @ 47 = IF INCY @ NEGATE INCY ! BOOP THEN
  INCX @ BALLX +!
  INCY @ BALLY +!
  1 BALLCLR DUP @ DGRCOLOR +!
  0   0 BALLX @ BALLY @ DGRLINE
  79 47 BALLX @ BALLY @ DGRLINE
  0  47 BALLX @ BALLY @ DGRLINE
  79  0 BALLX @ BALLY @ DGRLINE
;

: BOUNCE
  0 DGRMODE DROP
  0 DGRDRAWBUF
  0 DGRCLEAR
  BEGIN
    MOVEBALL
    KEY?
  UNTIL
  KEY DROP
  -1 DGRMODE DROP
;

BOUNCE
