home *** CD-ROM | disk | FTP | other *** search
/ Encyklopedia Omnia / Planeta.iso / data / a_gen.dir / 00063_cropDragger2.ls < prev    next >
Encoding:
Text File  |  2000-11-14  |  2.6 KB  |  80 lines

  1. property firstSlotNS, voidCrop, nsIntersector, origLoc, draggedSprite, maxErrori
  2. global gNumErrori, gListaEsatti, gCurrentStartCrop, gCropList, gCanClick
  3.  
  4. on beginSprite
  5.   set draggedSprite to the currentSpriteNum
  6.   set the cursor of sprite draggedSprite to [member "palmo", member "palmo_m"]
  7. end
  8.  
  9. on tastoGiu
  10.   set draggedSprite to the currentSpriteNum
  11.   if the moveableSprite of sprite draggedSprite and gCanClick then
  12.     set the cursor of sprite draggedSprite to [member "pugno", member "pugno_m"]
  13.     set origLoc to the loc of sprite draggedSprite
  14.   end if
  15. end
  16.  
  17. on tastoSu
  18.   if the moveableSprite of sprite draggedSprite and gCanClick then
  19.     if sprite draggedSprite intersects sprite(nsIntersector) then
  20.       set nm to the name of member the member of sprite draggedSprite
  21.       if getPos(gListaEsatti, nm) <> 0 then
  22.         puppetSound(1, "Subping")
  23.         deleteOne(gListaEsatti, nm)
  24.         set newLoc to the loc of sprite draggedSprite
  25.         set newSprite to 34 - count(gListaEsatti) + 1
  26.         set the member of sprite newSprite to the member of sprite draggedSprite
  27.         set the loc of sprite newSprite to newLoc
  28.         set the member of sprite draggedSprite to member voidCrop
  29.         set the loc of sprite draggedSprite to origLoc
  30.         set the moveableSprite of sprite draggedSprite to 0
  31.         set p to getPos(gCropList, nm)
  32.         setAt(gCropList, p, EMPTY)
  33.         updateStage()
  34.         if count(gListaEsatti) = 0 then
  35.           go(marker(2))
  36.         end if
  37.       else
  38.         puppetSound(1, "H_si")
  39.         set gNumErrori to gNumErrori + 1
  40.         set the cursor of sprite draggedSprite to [member "palmo", member "palmo_m"]
  41.         set the loc of sprite draggedSprite to origLoc
  42.         updateStage()
  43.         if gNumErrori > maxErrori then
  44.           go(#next)
  45.         end if
  46.       end if
  47.     else
  48.       puppetSound(1, "pswitch")
  49.       set the cursor of sprite draggedSprite to [member "palmo", member "palmo_m"]
  50.       set the loc of sprite draggedSprite to origLoc
  51.       updateStage()
  52.     end if
  53.   end if
  54. end
  55.  
  56. on mouseDown
  57.   tastoGiu()
  58. end
  59.  
  60. on rightMouseDown
  61.   tastoGiu()
  62. end
  63.  
  64. on mouseUp
  65.   tastoSu()
  66. end
  67.  
  68. on rightMouseUp
  69.   tastoSu()
  70. end
  71.  
  72. on getPropertyDescriptionList
  73.   set d to [:]
  74.   addProp(d, #firstSlotNS, [#default: 15, #format: #integer, #comment: "Numero canale primo slot:"])
  75.   addProp(d, #voidCrop, [#default: "voidCrop", #format: #string, #comment: "Nome del crop fittizio:"])
  76.   addProp(d, #nsIntersector, [#comment: "Sprite Intersector:", #format: #integer, #default: 13])
  77.   addProp(d, #maxErrori, [#comment: "Max errori:", #format: #integer, #default: 5])
  78.   return d
  79. end
  80.