A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: simple game to implement

  1. #1
    if you go first
    Join Date
    Oct 2005
    Location
    Herts, UK
    Posts
    62

    simple game to implement

    Hi guys,

    I was wondering if anyone could shed some light on the best way to produce this very simple little game in Flash (8).

    _The Game_
    It's an old Chinese game consisting of counters which are removed from the board by two players in turn.

    There are three lines of 6, 4 and 1 counters:
    o
    oooo
    oooooo

    Each player must remove as many counters as he likes (min 1) from any *single* line.

    The winner is the one to force his/her opponent to take the last counter.
    ____________


    There is a method to guarantee victory for the person going first.

    How can I turn this into a little flash game with player vs computer?

    How would I keep the code modular?

    Thanks,
    fm
    <insert witty signature here>

  2. #2
    if you go first
    Join Date
    Oct 2005
    Location
    Herts, UK
    Posts
    62
    Things aren't working...

    I have three different colours for the three lines of counters. The bottom line, with 6 counters, is red. These counters are movieclips called "red1, red2, etc."

    I have the following actionscript in frame 1:

    Code:
    var playerScore:Number = 0;
    var compScore:Number = 0;
    var choice:String = "none";
    
    red1.onRelease = redHit(1);
    red2.onRelease = redHit(2);
    red3.onRelease = redHit(3);
    red4.onRelease = redHit(4);
    red5.onRelease = redHit(5);
    red6.onRelease = redHit(6);
    
    function redHit(num:Number) {
    	trace("red function");
    	_root.red--;
    	_root.choice = "red";
    	unloadMovie("red" + num);
    	trace(num);
    }
    The problem is that the six lines "...red4.onRelease = redHit(4);..." are executing without the movieclips being clicked on. So I've moved the instances a few frames back, to frame three. Now, they stay there, but when I click on them, they don't unload.

    Does anyone know why?

    Thanks,
    fm
    <insert witty signature here>

  3. #3
    if you go first
    Join Date
    Oct 2005
    Location
    Herts, UK
    Posts
    62
    can anyone help?
    <insert witty signature here>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center