home *** CD-ROM | disk | FTP | other *** search
- global everyOk
-
- on beginSprite me
- sprite(me.spriteNum).visible = 1
- sprite(me.spriteNum).loc = point(98, 84)
- sprite(me.spriteNum).member = "backofcard"
- end
-
- on mouseDown me
- global tableau, stock, firstSprite
- if everyOk = 1 then
- n = 0
- repeat with i = 1 to tableau.count
- n = n + 1
- if stock.cards.count = 0 then
- exit repeat
- end if
- if tableau[i].cards.count = 0 then
- fixempty(i)
- next repeat
- end if
- if tableau[i].cards.count = 20 then
- next repeat
- end if
- puppetSound(3, "deal1")
- sprite(tableau[i].cards[tableau[i].cards.count].spnum + 1).member = stock.cards[1].rank & "_" & stock.cards[1].suit
- sprite(tableau[i].cards[tableau[i].cards.count].spnum + 1).visible = 1
- sprite(tableau[i].cards[tableau[i].cards.count].spnum + 1).locZ = tableau[i].cards[tableau[i].cards.count].spnum + 1
- tableau[i].addcards(symbol(string(tableau[i].cards[tableau[i].cards.count].spnum + 1)), new(script("card"), tableau[i].cards[tableau[i].cards.count].spnum + 1))
- stock.cards.deleteAt(1)
- updateStage()
- end repeat
- if stock.cards.count = 0 then
- sprite(me.spriteNum).visible = 0
- checklose()
- end if
- repeat with i = 150 to 156
- sprite(i).loc = tableau[string(sprite(i).startFrame)].cards[tableau[string(sprite(i).startFrame)].cards.count].location
- end repeat
- end if
- end
-
- on fixempty ui
- global tableau, stock, firstSprite
- sprite(firstSprite[ui]).member = stock.cards[1].rank & "_" & stock.cards[1].suit
- stock.cards.deleteAt(1)
- sprite(firstSprite[ui]).visible = 1
- tableau[string(sprite(firstSprite[ui]).startFrame).symbol].addcards(string(firstSprite[ui]).symbol, new(script("card"), firstSprite[ui]))
- sprite(firstSprite[ui]).locZ = firstSprite[ui]
- end
-