home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a067 / 1.img / GRUMP501.EXE / FALLGUY.PRG < prev    next >
Encoding:
Text File  |  1991-04-29  |  1.6 KB  |  49 lines

  1. /*
  2.    Program: FALLGUY()
  3.    System: GRUMPFISH LIBRARY
  4.    Author: Greg Lief
  5.    Copyright (c) 1988-90, Greg Lief
  6.    Clipper 5.x version
  7.    Compile instructions: clipper fallguy /n/w/a
  8. */
  9.  
  10. #include "grump.ch"
  11.  
  12. function fallguy(mrow, mcol, msg, delay)
  13. local nrow, ncol, cbuffer, xx, ntone, oldcurs := setcursor(0)
  14. if mrow != NIL .and. mcol != NIL .and. msg != NIL
  15.    //----- establish starting tone based on row and length of message
  16.    ntone := mrow / 3 * len(msg) * 50 + 150
  17.    for ncol = mcol to mcol + len(msg) - 1
  18.       if substr(msg, ncol - mcol + 1, 1) != chr(32)
  19.          for nrow = 0 to mrow
  20.             //----- save the screen coordinate that is about to be erased
  21.             cbuffer := savescreen(nrow, ncol, nrow, ncol)
  22.             //----- draw falling letter at that location
  23.             @ nrow, ncol ssay substr(msg, ncol - mcol + 1, 1)
  24.             if delay == NIL       // if no delay passed, use 'twinkle-tones'
  25.                if nrow % 3 == 0   // only sound off at every 3rd row
  26.                   tone(ntone -= 50, 1)
  27.                endif
  28.             else
  29.                for xx = 1 to delay
  30.                next
  31.             endif
  32.             if nrow < mrow
  33.                //───── restore affected portion of screen
  34.                restscreen(nrow, ncol, nrow, ncol, cbuffer)
  35.             endif
  36.          next
  37.       else   // a falling space would look pretty stupid, at least to me
  38.          @ mrow, ncol ssay chr(32)
  39.       endif
  40.    next
  41. endif
  42. setcursor(oldcurs)
  43. return NIL
  44.  
  45. * end function FallGuy()
  46. *--------------------------------------------------------------------*
  47.  
  48. * eof fallguy.prg
  49.