dcsimg
A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Help with designing a Board Game

  1. #1
    Junior Member
    Join Date
    Feb 2003
    Location
    Sydney, Australia
    Posts
    4

    Help with designing a Board Game

    I'm a year 11 student, studying Software Design and my major project is to create an electronic version of a board game that currently exists. The requirements that this game must meet are:

    * use of simple and structured data types
    * accept data input and perform data validation
    * accept keyboard intercepts
    * use a random number generator
    * enable multiplayer operation
    * maintain a high score list

    The board game I have decided to use is Ludo. I've adapted the game to suit some of the requirements. The board game will be based on the webcomic 8-Bit Theatre (http://www.nuklearpower.com/). I've attached a screen shot to make it easier to picture what I'm trying to describe. Because the original game of Ludo does not have a scoring system, I've created one.

    SCORING SYSTEM:
    For a first place finish (all pieces must have made it to the finish line), a player receives 4 points. For every place after, there is a deduction of 1 point (i.e. 3rd - 3 points, 2nd - 2 points, 4th - 1 point) from the maximum of 4 points.
    If a player lands on a square that is occupied by another player's piece, the other piece is sent back to the start and the player is awarded a point.
    i.e. Player A's playing piece lands on a square occupied by Player B's piece. Player B's piece gets sent back to the start while Player A receives 1 point for a "kill".
    The total score of a player is their kill score, plus their place score (the amount of points they got for their place finish). The winner is the player with the highest total score. A maximum of 5 Ludo games can be played in a Tournament, where a player's total score is accumulated throughout the 5 games.

    Right now the biggest problem I'm having is not being able to figure out how to get each piece to move according to the die roll, due to the complex rules regarding the movement of playing pieces. For example:

    * for any piece that is within the starting area, there must be a check made to see if the die roll is 2, 4 or 6. If not, the piece is not allowed to be moved.

    Originally I thought to give each square on the game board a co-ordinate, so the player rolls the die, the game shows them which piece they can move and they would choose it and the piece would automatically be moved ahead by the number of spaces indicated by the die.

    Currently, there are 40 squares on the main game track, plus an additional 16 for the home tracks and a final finish square. That comes to a total of 57 squares that would need to have their own individual co-ordinates.

    Does anyone have any suggestions on how I could make this possible/easier to code?
    Attached Images Attached Images

  2. #2

  3. #3
    ism BlinkOk's Avatar
    Join Date
    Aug 2001
    Location
    , location, location
    Posts
    5,002
    this is a sample i did for someone interested in a monoply game. i don't know how much help it will be though.
    http://www.nlc.net.au/~oceana/games/m1.swf
    http://www.nlc.net.au/~oceana/games/m1.zip
    Graphics Attract, Motion Engages, Gameplay Addicts
    XP Pro | P4 2.8Ghz | 2Gb | 80Gb,40Gb | 128Mb DDR ATI Radeon 9800 Pro

  4. #4
    Who needs pants? hooligan2001's Avatar
    Join Date
    Apr 2001
    Location
    Somewhere
    Posts
    1,976
    Thats a nice monopoly sample you got their blink

    year 11 student, studying Software Design, since when did they start programing in year 11, woops i did it just remembered. Information Systems but that was a while back now.

  5. #5
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,227
    Heres how I would go for it (best I could think of for now).

    Make each square a movie clip and name the squares like in the pic I attached. So first black mage starting tile from up-left would be something like "s1", next "s2"... and last starting square for thief would be "s16".

    Normal board squares would go from "s17" to "s56" and from "s57" would start finishing squares.

    Each players piece would also know, on which tile it stands. Couple variables maybe, like:
    player1_piece1=1;

    Now create walking path for each player, it could be made simply with cople if statements. For black mage:

    if player1_piece1<17
    check for dice being 2,4,6
    if yes, move piece to 17
    new=17

    if player1_piece1>16 and if player1_piece1<56
    move piece to next square
    new=if player1_piece1+1

    if player1_piece1>55
    move piece to 57
    new=57

    if player1_piece1>56
    new=if player1_piece1+1
    check if its finished

    Each player would have different code obviously, where he goes on board or to finish squares.

    The actual moving can be done simply by getting _x/_y of target mc and moving piece there.


  6. #6
    Junior Member
    Join Date
    Feb 2003
    Location
    Sydney, Australia
    Posts
    4
    hooligan2001: Technically I'm in Year 11, but my school's kindly allowed me to accelerate 1 year for Software Design so I'll be sitting my HSC/final exams this year. I wasn't too sure about it but my teacher seemed pretty confident...so I guess I'm stuck with it

    tonypa: I'm still fairly new with the whole Flash thing, so these questions are gonna sound pretty dumb. I've tried looking around for tutorials on board games and there didn't seem to be any. With those if statements, do I place them into the timeline or attach them to the MC of the pieces? And how would I go about getting the _x/_y values of the target MCs and actually moving the pieces there?

    BlinkOk: I've downloaded your file and am currently poking around in it. It'll take me a while to figure out the actionscript I'm wading through though

    D and J Media: Thanks for pointing out that thread to me. I'm going to experiment around and see how I can adapt it for 4 players.

    Thanks for all your help everyone! I'll try it all out and see what happens and where I mess up

  7. #7
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,227
    Originally posted by xinxin

    tonypa: I'm still fairly new with the whole Flash thing, so these questions are gonna sound pretty dumb. I've tried looking around for tutorials on board games and there didn't seem to be any. With those if statements, do I place them into the timeline or attach them to the MC of the pieces? And how would I go about getting the _x/_y values of the target MCs and actually moving the pieces there?
    I dont have any actual actionscript code for you, everything I wrote is only idea how I would do it. Where you put statements or how the code for game would look like is mostly up to you. Games can be done in many different ways so there is not one and only right solution for each and every game.

    Try to think of what you want to achieve and break it down into smaller problems. You can also press F1 in Flash to get help.

    For getting position of mc, you can use
    targetx=targetmc._x;

    If you create name of target mc dynamically, you can use:
    number=1;
    targetx = eval("s"+number)._x;
    When number=1, this would get x position of "s1" mc and by changing variable number, you can get x position of all mc named like: s2, s3, s5, s798377

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