home *** CD-ROM | disk | FTP | other *** search
/ 100 Plus Great Games 2 / 100PLUSV2.BIN / games / AgnesSorel.dxr / 00072_stock.ls < prev    next >
Encoding:
Text File  |  2002-01-25  |  1.8 KB  |  51 lines

  1. global everyOk
  2.  
  3. on beginSprite me
  4.   sprite(me.spriteNum).visible = 1
  5.   sprite(me.spriteNum).loc = point(98, 84)
  6.   sprite(me.spriteNum).member = "backofcard"
  7. end
  8.  
  9. on mouseDown me
  10.   global tableau, stock, firstSprite
  11.   if everyOk = 1 then
  12.     n = 0
  13.     repeat with i = 1 to tableau.count
  14.       n = n + 1
  15.       if stock.cards.count = 0 then
  16.         exit repeat
  17.       end if
  18.       if tableau[i].cards.count = 0 then
  19.         fixempty(i)
  20.         next repeat
  21.       end if
  22.       if tableau[i].cards.count = 20 then
  23.         next repeat
  24.       end if
  25.       puppetSound(3, "deal1")
  26.       sprite(tableau[i].cards[tableau[i].cards.count].spnum + 1).member = stock.cards[1].rank & "_" & stock.cards[1].suit
  27.       sprite(tableau[i].cards[tableau[i].cards.count].spnum + 1).visible = 1
  28.       sprite(tableau[i].cards[tableau[i].cards.count].spnum + 1).locZ = tableau[i].cards[tableau[i].cards.count].spnum + 1
  29.       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))
  30.       stock.cards.deleteAt(1)
  31.       updateStage()
  32.     end repeat
  33.     if stock.cards.count = 0 then
  34.       sprite(me.spriteNum).visible = 0
  35.       checklose()
  36.     end if
  37.     repeat with i = 150 to 156
  38.       sprite(i).loc = tableau[string(sprite(i).startFrame)].cards[tableau[string(sprite(i).startFrame)].cards.count].location
  39.     end repeat
  40.   end if
  41. end
  42.  
  43. on fixempty ui
  44.   global tableau, stock, firstSprite
  45.   sprite(firstSprite[ui]).member = stock.cards[1].rank & "_" & stock.cards[1].suit
  46.   stock.cards.deleteAt(1)
  47.   sprite(firstSprite[ui]).visible = 1
  48.   tableau[string(sprite(firstSprite[ui]).startFrame).symbol].addcards(string(firstSprite[ui]).symbol, new(script("card"), firstSprite[ui]))
  49.   sprite(firstSprite[ui]).locZ = firstSprite[ui]
  50. end
  51.