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