home *** CD-ROM | disk | FTP | other *** search
- property nsIntersector, origLoc, draggedSprite, corretto, maxErrori, numEsatti
- global gNumErrori, gNumEsatti
-
- on beginSprite
- set draggedSprite to the currentSpriteNum
- set the cursor of sprite draggedSprite to [member "palmo", member "palmo_m"]
- end
-
- on mouseUp
- tastoSu()
- end
-
- on mouseDown
- tastoGiu()
- end
-
- on rightMouseUp
- tastoSu()
- end
-
- on rightMouseDown
- tastoGiu()
- end
-
- on tastoGiu
- set draggedSprite to the currentSpriteNum
- if the moveableSprite of sprite draggedSprite = 1 then
- set the cursor of sprite draggedSprite to [member "pugno", member "pugno_m"]
- set origLoc to the loc of sprite draggedSprite
- end if
- end
-
- on tastoSu
- if the moveableSprite of sprite draggedSprite = 1 then
- if spriteInside(draggedSprite, nsIntersector) then
- if corretto = #si then
- puppetSound(1, "E_si")
- set gNumEsatti to gNumEsatti + 1
- set the cursor of sprite draggedSprite to 0
- set newLoc to the loc of sprite draggedSprite
- set the loc of sprite draggedSprite to newLoc
- set the moveableSprite of sprite draggedSprite to 0
- updateStage()
- if gNumEsatti = numEsatti then
- go(marker(2))
- end if
- else
- puppetSound(1, "E_no")
- set gNumErrori to gNumErrori + 1
- set the cursor of sprite draggedSprite to [member "palmo", member "palmo_m"]
- set the loc of sprite draggedSprite to origLoc
- updateStage()
- if gNumErrori > maxErrori then
- go(#next)
- end if
- end if
- else
- set the cursor of sprite draggedSprite to [member "palmo", member "palmo_m"]
- set the loc of sprite draggedSprite to origLoc
- updateStage()
- end if
- end if
- end
-
- on spriteInside pFreeSprite, pFixedSprite
- set freeRect to the rect of sprite pFreeSprite
- set fixedRect to the rect of sprite pFixedSprite
- set p1 to point(getAt(freeRect, 1), getAt(freeRect, 2))
- set p2 to point(getAt(freeRect, 3), getAt(freeRect, 4))
- if inside(p1, fixedRect) and inside(p2, fixedRect) then
- return 1
- else
- return 0
- end if
- end
-
- on getPropertyDescriptionList
- set p_list to [#nsIntersector: [#comment: "Sprite Intersector:", #format: #integer, #default: 9], #corretto: [#comment: "Esatto?", #format: #symbol, #range: [#si, #no], #default: #no], #maxErrori: [#comment: "Max errori:", #format: #integer, #default: 2], #numEsatti: [#comment: "Risposte esatte:", #format: #integer, #default: 2]]
- return p_list
- end
-