home *** CD-ROM | disk | FTP | other *** search
/ What PC? 1997 December / WPCDEC97.ISO / DXRS / CYRIXO.DXR / 00189_CrSlidePuz.ls < prev    next >
Encoding:
Text File  |  1997-10-13  |  2.8 KB  |  61 lines

  1. on CrSlidePuz
  2.   global CySlidePosList
  3.   if (the mouseH > 386) and (the mouseH < 579) and (the mouseV > 63) and (the mouseV < 254) then
  4.     repeat while (the mouseH > 386) and (the mouseH < 579) and (the mouseV > 63) and (the mouseV < 254)
  5.       repeat with f = 1 to count(CySlidePosList)
  6.         set WhichBox to getAt(getAt(CySlidePosList, f), 1)
  7.         if rollOver(WhichBox) and the mouseDown then
  8.           set Dotx to getAt(getAt(CySlidePosList, 1), 3)
  9.           set Doty to getAt(getAt(CySlidePosList, 1), 4)
  10.           set Boxx to getAt(getAt(CySlidePosList, f), 3)
  11.           set Boxy to getAt(getAt(CySlidePosList, f), 4)
  12.           if ((((Dotx + 1) = Boxx) or ((Dotx - 1) = Boxx)) and (Doty = Boxy)) or ((((Doty + 1) = Boxy) or ((Doty - 1) = Boxy)) and (Dotx = Boxx)) then
  13.             set DotLocx to getAt(getAt(CySlidePosList, 1), 5)
  14.             set DotLocy to getAt(getAt(CySlidePosList, 1), 6)
  15.             set BoxLocx to getAt(getAt(CySlidePosList, f), 5)
  16.             set BoxLocy to getAt(getAt(CySlidePosList, f), 6)
  17.             if Dotx < Boxx then
  18.               repeat while the locH of sprite WhichBox <> DotLocx
  19.                 set the locH of sprite WhichBox to the locH of sprite WhichBox - 1
  20.                 updateStage()
  21.               end repeat
  22.             else
  23.               if Dotx > Boxx then
  24.                 repeat while the locH of sprite WhichBox <> DotLocx
  25.                   set the locH of sprite WhichBox to the locH of sprite WhichBox + 1
  26.                   updateStage()
  27.                 end repeat
  28.               else
  29.                 if Doty < Boxy then
  30.                   repeat while the locV of sprite WhichBox <> DotLocy
  31.                     set the locV of sprite WhichBox to the locV of sprite WhichBox - 1
  32.                     updateStage()
  33.                   end repeat
  34.                 else
  35.                   if Doty > Boxy then
  36.                     repeat while the locV of sprite WhichBox <> DotLocy
  37.                       set the locV of sprite WhichBox to the locV of sprite WhichBox + 1
  38.                       updateStage()
  39.                     end repeat
  40.                   end if
  41.                 end if
  42.               end if
  43.             end if
  44.             set the loc of sprite WhichBox to point(DotLocx, DotLocy)
  45.             set the loc of sprite 3 to point(BoxLocx, BoxLocy)
  46.             updateStage()
  47.             setAt(getAt(CySlidePosList, f), 3, Dotx)
  48.             setAt(getAt(CySlidePosList, f), 4, Doty)
  49.             setAt(getAt(CySlidePosList, f), 5, DotLocx)
  50.             setAt(getAt(CySlidePosList, f), 6, DotLocy)
  51.             setAt(getAt(CySlidePosList, 1), 3, Boxx)
  52.             setAt(getAt(CySlidePosList, 1), 4, Boxy)
  53.             setAt(getAt(CySlidePosList, 1), 5, BoxLocx)
  54.             setAt(getAt(CySlidePosList, 1), 6, BoxLocy)
  55.           end if
  56.         end if
  57.       end repeat
  58.     end repeat
  59.   end if
  60. end
  61.