home *** CD-ROM | disk | FTP | other *** search
/ Smart Steps: 2nd Grade / SSGRADE2.iso / pc / media / notions / maths / m2008.dxr / 00001.ls next >
Encoding:
Text File  |  1999-03-27  |  4.2 KB  |  166 lines

  1. on startMovie
  2.   global CrayonLocation, gNumeroMod, gFiltre, Consigne
  3.   set Consigne to 1
  4.   set CrayonLocation to point(the mouseH, the mouseV)
  5.   set gFiltre to 0
  6.   InitMain()
  7.   repeat with i = 44 to 47
  8.     Cmain(i, 2)
  9.   end repeat
  10.   set the timeoutLength to 20 * 60
  11. end
  12.  
  13. on timeout
  14.   global CrayonLocation
  15.   if CrayonLocation = point(the mouseH, the mouseV) then
  16.     set the blend of sprite 48 to 0
  17.     dorelance(41)
  18.     set the blend of sprite 48 to 100
  19.   else
  20.     set CrayonLocation to point(the mouseH, the mouseV)
  21.   end if
  22. end
  23.  
  24. on TireAuHasard
  25.   global Tableau, gHasard
  26.   set Hasard to 1
  27.   set Combien to 5
  28.   set Tableau to []
  29.   repeat with i = 1 to Combien
  30.     add(Tableau, i)
  31.   end repeat
  32.   if gHasard then
  33.     repeat with i = 1 to Combien
  34.       set rangHasard to random(Combien)
  35.       set tempP1 to getAt(Tableau, rangHasard)
  36.       set tempP2 to getAt(Tableau, i)
  37.       setAt(Tableau, i, tempP1)
  38.       setAt(Tableau, rangHasard, tempP2)
  39.     end repeat
  40.   end if
  41. end
  42.  
  43. on Pinter Sprite1, Sprite2, ToleranceH, ToleranceV
  44.   set SPH1 to the locH of sprite Sprite1
  45.   set SPH2 to the locH of sprite Sprite2
  46.   set SPV1 to the locV of sprite Sprite1
  47.   set SPV2 to the locV of sprite Sprite2
  48.   if SPH1 > SPH2 then
  49.     set DifH to SPH1 - SPH2
  50.   else
  51.     set DifH to SPH2 - SPH1
  52.   end if
  53.   if SPV1 > SPV2 then
  54.     set DifV to SPV1 - SPV2
  55.   else
  56.     set DifV to SPV2 - SPV1
  57.   end if
  58.   if (DifH <= ToleranceH) and (DifV <= ToleranceV) then
  59.     set OK to 1
  60.   else
  61.     set OK to 0
  62.   end if
  63.   return OK
  64. end
  65.  
  66. on gereTable
  67.   global lastXPos, lastYPos, rowNumber, columnNumber
  68.   set pasVertical to 29
  69.   set orgVertical to 63 + 29
  70.   set myMouseV to the mouseV
  71.   set rowNumber to integer((myMouseV - orgVertical) / pasVertical)
  72.   if rowNumber < 0 then
  73.     set rowNumber to 0
  74.   end if
  75.   if rowNumber > 9 then
  76.     set rowNumber to 9
  77.   end if
  78.   if rowNumber = 0 then
  79.     set the memberNum of sprite 31 to 40
  80.   end if
  81.   if rowNumber = 1 then
  82.     set the memberNum of sprite 31 to 41
  83.   end if
  84.   if rowNumber = 2 then
  85.     set the memberNum of sprite 31 to 42
  86.   end if
  87.   if rowNumber = 3 then
  88.     set the memberNum of sprite 31 to 43
  89.   end if
  90.   if rowNumber = 4 then
  91.     set the memberNum of sprite 31 to 44
  92.   end if
  93.   if rowNumber = 5 then
  94.     set the memberNum of sprite 31 to 45
  95.   end if
  96.   if rowNumber = 6 then
  97.     set the memberNum of sprite 31 to 46
  98.   end if
  99.   if rowNumber = 7 then
  100.     set the memberNum of sprite 31 to 47
  101.   end if
  102.   if rowNumber = 8 then
  103.     set the memberNum of sprite 31 to 48
  104.   end if
  105.   if rowNumber = 9 then
  106.     set the memberNum of sprite 31 to 49
  107.   end if
  108.   if rowNumber = 10 then
  109.     set the memberNum of sprite 31 to 50
  110.   end if
  111.   set the locV of sprite 33 to orgVertical + 16 + (rowNumber * pasVertical)
  112.   set the locV of sprite 32 to orgVertical + 16 + (rowNumber * pasVertical)
  113.   updateStage()
  114.   set pasHorizontal to 29
  115.   set orgHorizontal to 281 + 29
  116.   set myMouseH to the mouseH
  117.   set columnNumber to integer((myMouseH - orgHorizontal) / pasHorizontal)
  118.   if columnNumber < 0 then
  119.     set columnNumber to 0
  120.   end if
  121.   if columnNumber > 9 then
  122.     set columnNumber to 9
  123.   end if
  124.   if columnNumber = 0 then
  125.     set the memberNum of sprite 32 to 29
  126.   end if
  127.   if columnNumber = 1 then
  128.     set the memberNum of sprite 32 to 30
  129.   end if
  130.   if columnNumber = 2 then
  131.     set the memberNum of sprite 32 to 31
  132.   end if
  133.   if columnNumber = 3 then
  134.     set the memberNum of sprite 32 to 32
  135.   end if
  136.   if columnNumber = 4 then
  137.     set the memberNum of sprite 32 to 33
  138.   end if
  139.   if columnNumber = 5 then
  140.     set the memberNum of sprite 32 to 34
  141.   end if
  142.   if columnNumber = 6 then
  143.     set the memberNum of sprite 32 to 35
  144.   end if
  145.   if columnNumber = 7 then
  146.     set the memberNum of sprite 32 to 36
  147.   end if
  148.   if columnNumber = 8 then
  149.     set the memberNum of sprite 32 to 37
  150.   end if
  151.   if columnNumber = 9 then
  152.     set the memberNum of sprite 32 to 38
  153.   end if
  154.   if columnNumber = 10 then
  155.     set the memberNum of sprite 32 to 39
  156.   end if
  157.   set the locH of sprite 31 to orgHorizontal + 16 + (columnNumber * pasHorizontal)
  158.   set the locH of sprite 33 to orgHorizontal + 16 + (columnNumber * pasHorizontal)
  159.   if (lastXPos <> columnNumber) or (lastYPos <> rowNumber) then
  160.     puppetSound("Click out")
  161.     set lastXPos to columnNumber
  162.     set lastYPos to rowNumber
  163.   end if
  164.   updateStage()
  165. end
  166.