home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 9 / 09.iso / l / l074 / 1.ddi / BOUNCE.TRU < prev    next >
Encoding:
Text File  |  1985-01-02  |  602 b   |  22 lines

  1. ! A bouncing ball.
  2.  
  3. SET WINDOW 0, 30, 0, 20
  4.  
  5. LET delta = +1                         ! +1 is up, -1 is down
  6. LET x = 15                             ! Start in center
  7. LET y = 10
  8.  
  9. BOX CIRCLE x, x+1, y, y+1              ! Show first ball
  10. FLOOD x+.5, y+.5                       ! Fill in circle
  11. BOX KEEP x, x+1, y, y+1 in ball$       ! Remember that image
  12.  
  13. DO
  14.    BOX CLEAR x, x+2, y, y+2    ! Erase old ball plus border
  15.    LET y = y + delta           ! Continue on course
  16.  
  17.    IF y < 1 or y > 19 then LET delta = -delta   
  18.  
  19.    BOX SHOW ball$ at x,y               ! Draw new ball
  20. LOOP
  21. END
  22.