Everybody! This is important. In a few days, these forums will be moving over to using the totally sweet Discourse platform. To ensure this migration happens smoothly with no loss of content, these forums are currently in a read-only mode. I do apologize for the inconvenience.

There is never a good time to turn the forums off for an extended period of time, but I promise the new forums will be a billion times better. I'm pretty sure of it.

See you all on the other side in a few days, and if you have any (non-technical) questions, please e-mail me at kirupa@kirupa.com. For technical questions, try to find a tutorial that corresponds to what you are looking for and post in the comments section of that page.

Cheers,
Kirupa

Results 1 to 3 of 3

Thread: Plz HELP! i need to move game pieces according to a dice roll

  1. #1

    Plz HELP! i need to move game pieces according to a dice roll

    could any one help me I'm a beginner programmer and have a project to do in a class my project is to make a board game using flash MX...unfortunately I'm doing the game TROUBLE where you pop a die and move pieces according to the dice roll luckily i got the dice to roll but dont know how to move the game pieces according to the dice roll someone please help i've looked all over the net and cant find anything

  2. #2
    I've never worked with flash MX (started with AS3) but I'm sure you could use a switch
    statement, which is a neat alternative to a complicated set of if-else statements.

    I'm assuming you've got the value of the dice roll stored in a variable called diceRoll


    switch(diceRoll)
    {
    case 1:
    // this is where you put the code you want to execute when someone rolls a 1
    //
    break ;

    case 2:
    // the code for when someone rolls a 2
    //
    break ;

    case 3:
    // when someone rolls a 3
    //
    break ;

    case 4:
    // when someone rolls a 4
    //
    break ;

    case 5:
    // when someone rolls a 5
    //
    break ;

    case 6:
    // when someone rolls a 6
    //
    break ;

    } // end switch

    Apologies if I've completely misunderstood your question.
    Last edited by DiamondDog; June 6th, 2008 at 03:36 PM.

  3. #3
    207
    posts
    Registered User
    What do they teach you in this class?

    You ever done a flow chart? Plan out the behaviour of the game. Entirely, in great detail. Ignore the code until you've done that.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012