# Trouble Board Game

## Initial Design Idea

Austin Lam and Ashley Boylan plan to make the popular board game named Trouble. We thought this would be a good 3D model to create because of the challenge to make it. It will require us to use for loops and modules to reproduce parts of the board. In addition, it would be fun to make a game to incorporate more players, so you can play with more friends. Austin is a Computer Science major, and Ashley has minimal coding experience besides one coding class she took at JMU. Austin will learn to incorporate mathematical equations to be change the board per players and spots per shape. This will be learned through finding the geometry equations online to see if they successfully work in the code. Ashley will learn how to code to be able to help create the 3D board game. She will learn through watching YouTube videos and through Austin’s help. She is a mathematics major, so she can contribute to the math side of coding to construct the board game.

Below is a picture of the game board we are trying to make.

Picture credits from this website

## Design Iteration

The above picture of the code is an original draft of our code. The original code made the board using the formula side = 2*r*sin(180/n) where r was the radius (“boardDiameter”) and n is the number of players (“numPlayers”). For “module path(numSpots, sideLength),” it originally calculated the pegs per side of the board based off the number of players. Thus, the pegs would outline the perimeter of the board – as pictured above but not yet translated to the length of the square board. However, it’s now going to be changed to the pegs starting in the corners to generate the outside path instead. The “module spot()” outputs the pegs for the board because we are taking away a small circle from a bigger circle.

The second change for the game is going to be incorporating the start and end positions, so we need to create the code to generate the inside path leading to the middle of the board – which is not incorporated in the screenshot above since we did not write it yet.

Above is the new code with the revisions of the path for the pegs now calculated from the corners of the game board with the other two corners missing for the square. And, it also produces the path towards the center of the board to win the game.

## First Draft Print

The draft came out a success. The main purpose of our draft was to briefly check the alignment of the pegs/spots for the pathway along the game board. Each spot came out evenly spaced from one another as we have programmed. We learned that we can now encapsulate the corner of the board for each player and all we have to do is call the same method and rotate it depending on a set of variables the user inputs to shape the overall board. We may need to change the board set up for the home pegs as if the number of pieces increases, it may run off the board. We also need to implement the rotations according to the board shape and size and may need to print the game at a larger scale to ensure it holds pieces.

## Thingiverse Customizer

The user can modify four parameters: the diameter of the board, the number of spots per corner, the number of pieces the players have to move, and the size of the spots to hold the pieces. The code above sets the parameters for each of those 4 things that the user can modify. The user can select to have between 3-5 pieces and spots to be between 2-5 in diameter. Because the board must be able to hold all the spots, the size of the board must be at least 2 times larger than the number of spots times their diameter. In addition, the number of spots on each corner of the board has to be an odd value to balance the board.