This was a personal project. I designed all the elements of the game. I also programmed the game with the help of my wife. Below is the game along with a brief documentation of the code. Click on the grid below to start the game.

Brief Code Documentation

  • The board is divided into 9 parts, which each part given a number ( 1 - 9 )

  • An instance of both nought and a cross movie clip is put on every part. The name of the movie clip is follows the convention:

    noughtX_mc

    or

    crossX_mc

    where

    X = the grid number.

  • A variable "whoseTurn" is defined. This variable can have "nought" and "cross" values only. This will decide whether a cross or a nought will be shown on a click.

  • Each part has a button which when clicked will perform several actions. A sample code for the button is :

    [code]

    on (release) {
    eval("_root."+_root.whoseTurn+"2_mc")._visible = true;
    _root.pushValue(2);
    _root.disableMe(butt2)
    _root.whoseTurn = (_root.whoseTurn == "cross") ? "nought" : "cross";

    }

    [/code]

    So on click the button :

    1. eval("_root."+_root.whoseTurn+"2_mc")._visible = true;


    Decides which movie clip to make visible using the run time eval function depending upon the variable whoseturn, the number of the movie clip ( X ) is hardcoded as of now as i couldnt figure out the code to get the number of the grid dynamically using the button's instance name.

    2. _root.pushValue(2);

    calls the function :

    [code]

    function pushValue (valIs)
    {
    eval ("_root." + whoseTurn + "Arr").push (valIs);
    _root.crossArr.sort ();
    _root.noughtArr.sort ();
    _root.checkObjectArray (whoseTurn);
    }


    [/code]

 

  Not Just A Photographer   As a Photographer
  The Great Indian Roadtrip (2006)
  About Me   As a Journalist   The Great Australian Roadtrip (2007)
]
  As a Motorcyclist   The Great New Zealand Roadtrip (2008)
  As an Entrepreneur   Castrol Power1 Passion Hunt India (2009)
  As a Graphic Designer   The Great Ireland Zealand Roadtrip (2008)