home *** CD-ROM | disk | FTP | other *** search
/ Meeting Pearls 3 / Meeting_Pearls_III.iso / Pearls / tcp / Networking / TCP / Server / AmiSlate / SlateRexx / explode2.rexx < prev    next >
OS/2 REXX Batch file  |  1995-03-24  |  1KB  |  57 lines

  1. /* An Arexx script for use with AmiSlate:  
  2.  
  3.     Draws explosions emanating from the mouse whenever the mouse
  4.     is clicked
  5.     
  6.    
  7. */
  8. AMessage.QUIT        = 32    /* AmiSlate is shutting down */
  9.  
  10.  
  11. parse arg CommandPort ActiveString
  12.  
  13. address (CommandPort)
  14.  
  15. if (length(CommandPort) == 0) then do
  16.     say ""
  17.     say "Usage:  rx explode.rexx <REXXPORTNAME>"
  18.     say "        (REXXPORTNAME is usually AMISLATE)"
  19.     say ""
  20.     say "Or run from the Rexx menu within AmiSlate."
  21.     say ""
  22.     exit 0
  23.     end
  24.  
  25.  
  26. options results
  27.  
  28. GetWindowAttrs stem win.
  29.  
  30. MaxX = (win.width - 59)
  31. MaxY = (win.height - 54)
  32.  
  33. range = 35
  34. halfrange = trunc(range/2)
  35.  
  36. NumberOfLines = 30
  37.  
  38. do while (1)
  39.     waitevent stem event. MOUSEDOWN MOUSEUP QUIT
  40.     
  41.     if (event.type == AMessage.QUIT) then exit
  42.     
  43.     nL = NumberOfLines
  44.     mx = event.x
  45.     my = event.y
  46.     
  47.     do while (nL > 0)    
  48.         xx = mx + rand(range) - halfrange
  49.         yy = my + rand(range) - halfrange
  50.         line mx my xx yy
  51.         setfcolor rand(15) rand(15) rand(15) notbackground
  52.         nL = nL - 1
  53.         end
  54. end
  55.  
  56. rand:
  57.     return trunc(Random()*arg(1)/1000)