Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

board game in flash

I'm making a simple board game in Flash (using Actionscript 3), and I'm not sure how to get the counter/board piece to go around the board. Its really simple, all that needs to happen is to roll a dice (thats the easy part, obviously) and then get the piece to move that many places along the board. I've seen a few ways to do this, but ive struggled to follow exactly how to do them and i would like to know the most effective way. Any help would be greatly appreciated.

Comments

  • LuisDeveloperLuisDeveloper SpainPosts: 2Member

    my first question is how does the board look like? I mean, it is like the monopoly or like the checkers?

  • LuisDeveloperLuisDeveloper SpainPosts: 2Member

    If the board is like the monopoly (you always move in the same direction) you could generate one tile at a time.

    So first you load the first square, and this square generates the next one, and this one, the next one, and so on.

    when you threw the dice you can make a for loop to go through the squares. void move() {

    for (int i = 1; i < diceResult; i++)
    {
           //as each square has generated other square, you could store         //the reference of the next one on a variable
       currentSquare = currentSquare.nextOne;
    }
    

    }

Sign In or Register to comment.