home *** CD-ROM | disk | FTP | other *** search
/ PC Home 49 / PC_Home_Issue_49.iso / winprogs / playsk / jigsaw.dxr / 00093.ls < prev    next >
Encoding:
Text File  |  1996-06-30  |  1.3 KB  |  51 lines

  1. on whichPiece
  2.   global gMov, gPieceList, gCurrentSprite
  3.   repeat with i = 28 to 36
  4.     if the clickOn = i then
  5.       if gMov = 0 then
  6.         getPiece(getAt(gPieceList, i - 27), i)
  7.       end if
  8.       exit repeat
  9.       next repeat
  10.     end if
  11.     if the clickOn = 45 then
  12.       placePiece()
  13.       exit repeat
  14.     end if
  15.   end repeat
  16. end
  17.  
  18. on getPiece spritename, thisSprite
  19.   global gMov, gCurrentSprite
  20.   puppetSound("Click")
  21.   set gCurrentSprite to thisSprite
  22.   set the visible of sprite thisSprite to 0
  23.   puppetSprite(45, 1)
  24.   set the castNum of sprite 45 to the number of member spritename
  25.   set the visible of sprite 45 to 1
  26.   set gMov to 1
  27.   set the cursor of sprite 45 to 200
  28.   set the cursor of sprite 1 to 200
  29.   set the locH of sprite 45 to the mouseH
  30.   set the locV of sprite 45 to the mouseV
  31.   updateStage()
  32. end
  33.  
  34. on placePiece
  35.   global gMov, gCurrentSprite, gNoPlaced
  36.   set zonenum to gCurrentSprite - 18
  37.   set piecenum to gCurrentSprite - 9
  38.   if sprite zonenum within 45 then
  39.     puppetSound("right")
  40.     set the visible of sprite 45 to 0
  41.     puppetSprite(45, 0)
  42.     set the visible of sprite piecenum to 1
  43.     set gMov to 0
  44.     set gNoPlaced to gNoPlaced + 1
  45.     set the cursor of sprite 1 to 0
  46.     set the cursor of sprite 45 to 0
  47.   else
  48.     puppetSound("wrong")
  49.   end if
  50. end
  51.