4-in-a-Row Homebrew
.I have been working on a board game in which players drop pieces into an upright 7x6 board. The first to get four of a kind horizontally, vertically, or diagonally is the winner. Milton Bradley markets a similar game under the name Connect Four.The first picture is an actual screenshot of a single row, and the next part is a mockup of what the final kernel should look like. Making one row was the most difficult part, and repeating it will of course be simple. With any luck, I will be able to make this into a 1K game by September 30. The kernel at first glance seemed to be a lot easier than my Go kernel, but as usual it was more difficult than I expected. I tried out a bunch of designs before arriving at the one shown above.The middle of the pieces are a transposed playfield with some carefully timed background color changes at the edges of the board. The top and bottom are P0 on the left, P1 on the right, and BL in the middle. Of course, the middle columns are missiles. For a while I thought I would be able to set the playfield the score display colors, COLUP0 and COLUP1, but it turned out to be too difficult to control the color of the missiles. If it had worked I would have been able to use basically one routine to color the entire row of pieces. However, two routines is not bad.The individual pieces are colored with STX for blue, STY for red, or STA for the background color. Like my Go kernel, a short sequence of code will be placed in RAM so that the colors of each stone can be changed.I also did some 4-in-a-Row AI in C++. Since there are at most 7 possible moves at each play, the AI will be relatively simple. It is an ideal choice for my first homebrew board game.Once I get 4-in-a-Row working it will be possible to use this same kernel for several other games, including Ataxx.
5 Comments
Recommended Comments