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

  1. global aceisbase
  2.  
  3. on beginSprite me
  4.   global stock, fcount, foundation
  5.   if fcount = 1 then
  6.     sprite(me.spriteNum).member = stock.cards[1].rank & "_" & stock.cards[1].suit
  7.     sprite(me.spriteNum).loc = point(290, 86)
  8.     stock.cards.deleteAt(1)
  9.     foundation.addProp(string(me.spriteNum).symbol, new(script("foundationh"), []))
  10.     foundation[string(me.spriteNum).symbol].cards.add(new(script("card"), me.spriteNum))
  11.     aceisbase = foundation[string(me.spriteNum).symbol].cards[1].rankvalue
  12.   else
  13.     sprite(me.spriteNum).blendLevel = 0
  14.     sprite(me.spriteNum).loc = sprite(me.spriteNum - 1).loc + point(sprite(me.spriteNum).width + 12, 0)
  15.     foundation.addProp(string(me.spriteNum).symbol, new(script("foundationh"), []))
  16.     foundation[string(me.spriteNum).symbol].cards.add(foundation[string(me.spriteNum - (fcount - 1)).symbol].cards[1].rankvalue)
  17.   end if
  18.   fcount = fcount + 1
  19. end
  20.  
  21. on mouseEnter me
  22.   global card, equal_value, hots, foundation, tableau
  23.   if sprite(me.spriteNum).blendLevel <> 0 then
  24.     if (the clickOn <> 0) and (the clickOn <> me.spriteNum) then
  25.       if sprite(the clickOn).visible = 1 then
  26.         if sprite(the clickOn).moveableSprite = 1 then
  27.           hots = me.spriteNum
  28.           if objectp(tableau[string(sprite(the clickOn).startFrame).symbol].cards[string(the clickOn).symbol]) = 1 then
  29.             if tableau[string(sprite(the clickOn).startFrame).symbol].cards[string(the clickOn).symbol].compare_suit(foundation[string(me.spriteNum).symbol].cards[foundation[string(me.spriteNum).symbol].cards.count]) = 1 then
  30.               if tableau[string(sprite(the clickOn).startFrame).symbol].cards[string(the clickOn).symbol].compare_rankvalue(foundation[string(me.spriteNum).symbol].cards[foundation[string(me.spriteNum).symbol].cards.count]) = 1 then
  31.                 equal_value = 1
  32.               else
  33.                 equal_value = 0
  34.               end if
  35.             end if
  36.           end if
  37.         end if
  38.       end if
  39.     end if
  40.   else
  41.     if (the clickOn <> 0) and (the clickOn <> me.spriteNum) then
  42.       if sprite(the clickOn).moveableSprite = 1 then
  43.         if sprite(the clickOn).visible = 1 then
  44.           hots = me.spriteNum
  45.           if objectp(tableau[string(sprite(the clickOn).startFrame).symbol].cards[string(the clickOn).symbol]) = 1 then
  46.             if tableau[string(sprite(the clickOn).startFrame).symbol].cards[string(the clickOn).symbol].rankvalue = foundation[string(me.spriteNum).symbol].cards[foundation[string(me.spriteNum).symbol].cards.count] then
  47.               equal_value = 1
  48.             else
  49.               equal_value = 0
  50.             end if
  51.           end if
  52.         end if
  53.       end if
  54.     end if
  55.   end if
  56. end
  57.  
  58. on mouseLeave me
  59.   global equal_value, tableau, win, points
  60.   equal_value = 0
  61.   hots = 0
  62.   if points = (15 * 52) then
  63.     win = "yes"
  64.     go("gameover")
  65.   end if
  66. end
  67.