Uncategorized

Day 4, Testing the Code

In this meeting as well as during day 5, we focused on finalizing, troubleshooting, testing, and improving our code. We had to focus on several main issues that were challenging to work out in our code. The most challenging was the process of getting the correct colors to switch after a player input their turn. In Othello, when a player places a tile, they switch any of the tiles that they have captured from their opponent, which can happen in any direction as long as it is bounded by two tiles of the player’s color.

In our code, we had to determine the best way to check every direction around a chosen cell to ensure that:

  1. it was adjacent to a tile of the opposite color
  2. in the direction of the tile of the opposite color, there was a tile of its own color

When these conditions were met, the code would then backtrack along that direction and switch the opponent’s tiles in that series to capture them for the player who made the turn. One particular challenge for this process was figuring out the logic required to check in the diagonal directions around each placed tile. In a section of the code for switching tiles, shown below, it shows how we worked through this challenge. For a given selection, we checked along the diagonal direction (up and right). First, if it found an empty cell, it would stop checking that direction, otherwise if it found one of its own color, then it would go backwards along that direction, switching the tiles to the player’s color.

diagonal-code

Once we had the code working for each player’s turn, we implemented a counter to check if the board had been filled, which would denote the end of the game at which point the board would display which player had won the game. Additionally, we added some aesthetic features such as a startup animation which would play each time the game began.

Uncategorized

Day 5, Building the Board

Today we continued finishing the physical components of the board game. First we attached the neopixels onto a sheet of cardboard so they were secured into the correctly sized grid. We wanted to make the finished product look presentable, and resemble a traditional board game which players would be familiar with.we folded the cardboard over the top of the neopixels, and cut a hole the size of the board and attached a game surface to cover the board.

Next, we printed out an 8×8 grid with the same spacing as the lights on the neopixels which made it more clear which lights corresponded to each space on the board. Attaching this over the top of the board of LEDs also dispersed the light slightly so they shined evenly and were not too bright. We then sealed the pieces of cardboard together so it made a coherent game board, but allowed us to still access the neopixels if need be.

img_4286img_2296img_2297

Uncategorized

Day 3 meeting- group 4

Today in lab we finally got the Neopixels so we got right to work soldering them. We accidentally soldered each Neopixel the wrong way so when they were plugged in none of them worked. We thought the Neopixels didn’t work or there was a problem with the Arduino. After some investigation we figured out we had soldered the wrong end and we fixed the problem by resoldering the other end. Next we got to building the circuit for the two potentiometers, button and the Neopixels. We then started experimenting with the code. We had written some basic setup code before we showed up on that day to try and scroll through the potentiometers. After some minor bug fixings we were able to get the code mostly working for scrolling horizontally and vertically with the two potentiometers.

Here are two pictures of the working neopixels and the circuit:

img_2251 img_4997

Uncategorized

Day Two Lab

In the second day of lab we talked through prototyping ideas, outlined code and ordered materials. We started with talking through how we wanted the board to look and how to maneuver through it. Some options were force sensors or buttons on each tile or two potentiometers one for vertical and the other for horizontal navigation paired with a button to place a tile. We decided to go with the potentiometer option as there is limited inputs in the Arduino. Next we decided to use an 8 by 8 grid of neopixels for the board itself. We then started researching the code. Pretty quickly we realized we needed a special library to work with the neopixels. We tried multiple ones out and found one that would allow the entire board to be one large matrix so we stuck with that one. Next, we talked about the basic outline of the code. Some challenges we knew we were going to run into was the flipping of the board pieces especially in the diagonal direction and having the piece that was in play switch colors depending on who’s turn it was. Finally, we went through and added the neopixels to the order form so we could begin to create the board.

Here are some pictures of our initial coding outline:

img_2207img_2208

 

 

 

 

 

Uncategorized

Day one

Today we prototyped how to make our game Othello! We started by writing out a rough plan as to how the game will operate. We brainstormed different styles of making the boardgame to compare how we would want the game to be played, and what would be the best way to construct the game. One option which we discussed was making a board with physical pieces that the players would place down on the board. They could have sensors to show which player they belonged to, and activate LEDs to light up to the corresponding colors. This would be much more intensive on the components it would require and more complex to create. A second option we thought about would be to have a grid of LEDs and the players would use a controller with two potentiometers and a button to navigate the board and input their choices. If we continued with this second design, in a later iteration of the game it could be expanded to allow for remote play so that two players could have boards in separate locations and send the moves they make to each other.

We constructed two very low fidelity prototypes to represent how the game could be constructed. We sketched the game as an 8×8 grid with each box representing a neopixel. In one prototype, the little clear tiles represented the game pieces which could be placed on the board and activate the LEDs underneath. In the second prototype, it showed how the LEDs could be covered with a semi transparent covering so that they would not be visible, but they would shine through to look more visibly appealing.

 

img_2139 img_2141 img_2140