home *** CD-ROM | disk | FTP | other *** search
- property spriteNum, motion, location, row
- global tableau, getlist, equal, currentsel, godlist, foundation, points, stock
-
- on beginSprite me
- if not listp(tableau) then
- tableau = [:]
- end if
- row = determinerow()
- tableau.addProp(row, new(script("card pile")))
- location = sprite(spriteNum).loc
- end
-
- on mouseDown me
- if tableau[row].getcardcount() > 0 then
- if spriteNum = tableau[row].getlastcard().spnum then
- puppetSound(3, member("pick card", "100GPak Generic SFX"))
- sprite(spriteNum).locZ = spriteNum + 1000
- getlist = tableau[row]
- motion = timeout(string(spriteNum) && "motion").new(5, #moving, me)
- end if
- if sprite(spriteNum).member = member("empty", "playing cards") then
- sendSprite(spriteNum - 1, #mouseDown)
- end if
- end if
- end
-
- on moving me
- if the mouseDown then
- sprite(spriteNum).loc = the mouseLoc
- else
- if the mouseUp then
- sprite(spriteNum).locZ = spriteNum
- motion.forget()
- abort()
- end if
- end if
- end
-
- on mouseUp me
- if equal then
- puppetSound(3, member("pick card", "100GPak Generic SFX"))
- sprite(currentsel).member = member(sprite(spriteNum).member.name, "playing cards")
- sprite(spriteNum).member = member("empty", "playing cards")
- godlist.addCard(currentsel)
- sprite(spriteNum).loc = location
- tableau[row].cards.deleteOne(tableau[row].getlastcard())
- if objectp(foundation[sprite(currentsel).row]) then
- points = points + 10
- end if
- equal = 0
- currentsel = 0
- godlist = VOID
- getlist = VOID
- repeat with i = 71 to 74
- if tableau[sprite(i).row].getcardcount() = 0 then
- next repeat
- end if
- sprite(i).loc = tableau[sprite(i).row].getlastcard().location
- end repeat
- checkwin()
- else
- if not equal then
- puppetSound(3, member("drop card", "100GPak Generic SFX"))
- getlist = VOID
- sprite(spriteNum).loc = location
- end if
- end if
- end
-
- on determinerow me
- if (spriteNum >= 15) and (spriteNum <= 28) then
- return #one
- else
- if (spriteNum >= 29) and (spriteNum <= 42) then
- return #two
- else
- if (spriteNum >= 43) and (spriteNum <= 56) then
- return #three
- else
- if (spriteNum >= 57) and (spriteNum <= 70) then
- return #four
- end if
- end if
- end if
- end if
- end
-