4 Replies Latest reply on May 2, 2006 1:31 PM by Terrence Martineau

    Choose member randomly, edit, then don't change

    Miki_33

      Hi,
      I'm actually trying to do something quite simple that I'm sure will be a sinch for you guys.
      I'm trying to make a basic type of scrabble game where letters are chosen at random and then the user can move letters to the board and then choose new letters again if they want too. However, I don't want the letters that have already been placed on the scrabble board to be altered if the user decides to throw out the remaining 5 letters and get 5 new ones for example.

      I've got a Cast Library of 26 images (which are the individual letter pieces) and I've put a script on a "get letters" button that randomly chooses one of the letters to place in a blank image which I have placed in sprites 5 - 11.

      Like:
      on mouseDown
      set the memberNum of sprite 5 = random(26)
      set the memberNum of sprite 6 = random(26)
      set the memberNum of sprite 7 = random(26)
      set the memberNum of sprite 8 = random(26)
      set the memberNum of sprite 9 = random(26)
      set the memberNum of sprite 10 = random(26)
      set the memberNum of sprite 11 = random(26)
      end

      This works fine but for the random part but then I think I may need something like
      if sprite 5 within sprite 14 (which is the confines of the board) then there is no change to the sprite.

      I don't know how to script the last part.
      Help appreciated.