The forums have permanently moved to forum.kirupa.com. This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.


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