dcsimg
A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Random MC

  1. #1
    Junior Member
    Join Date
    May 2008
    Posts
    15

    Random MC

    I've a idea of creating a game with dice,

    the rule is,

    there will be two dice, each dice will have maximum of six dots, what i need is, i want the user to click on it and it should display in random images,

    can i use images or movieclip,

    how to do with movieclip ??

  2. #2
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    there will be two dice, each dice will have maximum of six dots, what i need is, i want the user to click on it and it should display in random images,
    not clear. Click on what, the dots? the dice? something else? and where do you want to display random images... the dice?

    A lot more info is needed. And the question should be clear if you want an accurate answer.

    gparis

  3. #3
    Junior Member
    Join Date
    May 2008
    Posts
    15
    ok let me say clearly,
    there will be two dice, when user click on those dice, the dots should be random in both the dices and with those output(random dots) i should move an object.

    how should i do??

    Last edited by lost2find; 05-22-2008 at 11:47 AM.

  4. #4
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    why not use 6 frames, with your six dots displays? Since i'm sure you'll display 5 in different spots than 6, it'll be simpler that way.

    That same number can also be used in your other 'move' function.
    then just generate a random number between 1 and 6, the send each dice timeline to that number.

    Check Math.random in the live docs (link in my footer) for an example in creating that type of function.

    Gparis

  5. #5
    http://www.in3d.eu Kostas Zotos's Avatar
    Join Date
    Jul 2007
    Location
    Athens - Greece
    Posts
    408
    Hi all,

    gparis suggestion is the recommended approach..

    As alternative, I've prepared a simple example wich attaches clips from the library according to a random dice number..

    [dice clips are very basic (and 2D), however you can replace them with more realistic graphics -you have to keep the same names and linkage IDs (if replace them) in order for the code to work -you may of course modify the code to follow any new name conventions- ]

    This mainly demonstrates a basic structure and how it works..

    Regards!

    Kostas
    Attached Files Attached Files
    Last edited by Kostas Zotos; 05-23-2008 at 12:05 PM.
    K. Zotos online portfolio: http://www.in3d.eu

  6. #6
    Junior Member
    Join Date
    May 2008
    Posts
    15
    thanks,thanks,thanks.....

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