A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Array's help

  1. #1
    I'm not junior
    Join Date
    Jul 2002
    Location
    Barcelone
    Posts
    54

    Array's help

    Hello FlashKitter's !!!

    I am making a game for a friend...
    The deal is to makes different color balls who falls and when they hit the floor or other balls they stop falling... and then check the environment !

    Ok, I give you an example !

    Imagine a red ball falling... It's falling till there's no obstacle below... So when it falls on the floor or meet an other ball, it stops and check the neighbourhood...

    the first step... the red ball will create a specific Array and it will store its position...
    The second step... the red ball will check if there's another red ball on its left side, right side or just below....

    If it find an other red ball... I want it to store the position of the other red ball in its specific Array...
    the other red ball will do the same checking operation... it will check on its left, right and below sides... if there's an other ball with the same color properties and not already included in the array... it will do the same operation as before... it will store the position of the new red ball... and so on !!!

    the third step...when there's 4 or more red balls in this specific Array... it launch a function which kills the red balls enclosed in this array... and make disapeared the corresponding red balls on the stage !!

    The question is
    I want to establish a specific Array as:
    "myArray" add firstBall = new Array();

    but this method doesn't work...
    Does anybody knows how to perform that !!!
    Thank's for helpin'
    Guitz
    abracadabra!!!
    www.300k.com

  2. #2
    Untitled-2.fla
    Join Date
    Jul 2002
    Posts
    391
    firstBall = 1
    this["array" + firstBall] = new Array()

  3. #3
    I'm not junior
    Join Date
    Jul 2002
    Location
    Barcelone
    Posts
    54
    Thank's for your quick reply !

    Another little question...
    If I have 2 different Arrays, with the same elements inside, but in a different order...
    Is there a function which can calculate this and return me TRUE (they have the same elements but in a different order...)
    abracadabra!!!
    www.300k.com

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