This is a pair optional assignment. You should create a directory called assignment 11 in cs170/assignments for this assignment. All code written for this assignment should be stored in that directory.
$ cd ~/cs170/assignments $ mkdir assignment11 $ cd assignment11
You have learned a lot over the course of this semester, so it is time for you to show everyone how much. This assignment is very open ended. So much so, that a description doesn't so much make sense. You can do essentially anything you want!
This assignment is open ended, but there are a few restrictions:
You must write up a short (1-2 paragraph) description for your proposed assignment. You should make sure to describe:
On Friday, April 25th 2016, We will have a showcase event during our final class period. During this time, you will be asked to give a breif demo of your project to the rest of the class. You should be prepared to answer questions about how your code works, and why you decided to undertake this project.
Grading for this assignment is slightly different than previous assignments. It will be graded according to the following criteria and percentages:
Bonus points may be awarded to programs that are viewed favorable by your fellow students. It is in your best interest to do your best!
For those that do not know the game, Break Out is a game similar to Pong that consists of a user controlled paddle and a ball bouncing around the screen. Break Out also includes bricks (rectangles) at the opposite side of the screen as the paddle. When the ball bounces off of the bricks they disappear. The player wins the game by making all of the bricks disappear.
The paddle should be on the bottom of the screen and only able to move laterally. There should be enough bricks to arrange them in a pattern at the top of the window. After the ball bounces off a brick, the brick should disappear. That is it should no longer be drawn and should no longer be checked for intersection with the ball. When all of the bricks have disappeared the program should display a congratulatory message.
You need to have at least two types of bricks in your game: Regular and Strong. Strong bricks should behave exactly like regular bricks as far as collisions are concerned. However, they should take multiple hits to break. These bricks should change color every time they are hit, so the user gets feedback on how many more hits a brick will take.
You will be required to use inheritance in this program. Remember that inheitance is great if there happens to be multiple classes that have attributes or behaviors that are shared between them. Examine the image above carefully. I chose the shapes for each of the pieces of the game very carefully to make inheritance work incredibly well for this program.
Note that the collision detection method covered in pong does not specify how to determine which side of a brick the ball collides with. A simple solution to this problem is to make the bricks wide but not very tall and to assume that all collisions are with either the top or bottom of the brick. Also note that that the collision detection method from lab can not determine which brick is hit first, if the ball is intersecting with multiple bricks. This can be a problem because if the ball does intersect with two bricks the result will be to change the velocity twice, and the ball will not bounce. A simple solution to this problem is to arrange the bricks so that it is not possible for the ball to intersect with multiple bricks simultaneously.
Settlers of Catan is a board game focused on resource gathering. Every tile on the game board specifies a type of resource that is generated for any settlement placed at one of the verticies on the edge of the tile. Each tile also gets assigned a number, which is the number that the dice needs to be rolled in order to generate that resource. A game begins by letting each player place two starter settlements on the board. There is a lot of strategy that goes into picking these first locations. Your task is to figure out which settlement locations give significantly more resources than other locations.
A game of Settlers of Catan consists of 19 hexagonal resource tiles. There are 3 Brick tiles, 1 Desert tile (which always gets assigned a dice roll of 7), 4 Forest tiles, 3 Ore tiles, 4 Sheep tiles, and 4 Wheat tiles. Each of these tiles are arranged in a hexagonal pattern. This pattern results in overlap between settlement locations: Some settlements locations appear on 3 resource tiles, while others only appear on one or two resource tiles. Consult the image below for more information about the board layout.
The catan_layout.in file specifies the structure of a bipartite graph: A graph with two disjoint sets of verticies. Verticies in one set do not have edges connecting them. The only edges that exist in this graph are between the two sets of verticies. In this program, the two types of verticies are Resources and Settlements. An edge exists between a resource tile and a settlement tile only if that settlement can exist on a resource tile.
You should read the input file specified above in order to generate a graph that resembles the image above. You can use either an adjacency matrix or a linked structure to accomplish this.
Once you have generated the graph as specified above, you should randomly assign resources (using the above distributions), as well as number tiles (There are two of every number in the range \([2-11]\) excluding two, seven, and twelve. There are only one of each of those numbers.).
The game of Settlers of Catan is played with two 6-sided dice. Roll these two dice, and their sum will identify a resource tile that should produce a resource for their settlements. For all of the settlement locations on this tile, you should identify which resource was generated and increment a counter for that resource type.
Run your program for at least 10,000 rolls of the dice. For each resource type, specify which settlement location would generate the most of that resource.
Your program should include the traditional header, use appropriate variable names, and nicely label all values printed to the terminal. Submission are to be done through inquire.roanoke.edu through the Assignment 11 link. Both partners must submit through inquire!