Code Critique

In the same teams you worked with for the last assignment, read, evaluate, and improve an initial implementation of this popular online game. This project's primary purpose is to help you start to build a sense of what makes one piece of code better than another given a specific set of design goals. Along the way, you should learn more about your game engine as well as its ability to support complex game development.
Start by reading the code to understand how it works; make a list of any questions you have about the code. While studying the code, also note any good things about it, that you might keep in the final version, as well as problems with the code. To help you understand the code, you should convert it to run using your game engine.
Your justification of which changes to make to the code rather than simply how many changes you make is the most important aspect of this assignment. In other words, if you feel strongly that the code is perfect as is and make no changes, you can still get an excellent grade if you completely justify why the code does not need to be changed in the context of your design objectives. On the other hand, you can also decide to scrap the code entirely and start over from scratch but, again, you must clearly justify your decisions and why the submitted code is better than the original. Justifications that refer specifically to principles given in the resources below will be given higher credit than those that use terms like "clearly/obviously", "good/sucks", or "like/hate".
Refactoring
Refactoring is the practice of updating a program to improve its design and maintainability without changing its current functionality significantly. An example of refactoring is creating a single function or class that replaces two or more sections of similar code because it reduces the amount of redundant code within the program and makes the code easier to debug and test. You should examine the given program and refactor it based on your critique and our discussion in class. You may create (and comment) any new functions or classes you want to help improve the program; however, you must justify each change you make by explaining specifically how it improves the code.
Improving
Finally, using your refactored code, describe how you would change the code to do each of the following:
- change the graphics and sounds used in the game
- change the scores given in the game
- add an additional level to the game
- add an additional bonus to the game
- make your additional bonus only available after a certain number of levels or points
Implement one of these changes.
Resources
The following readings provide principles for improving the design of the code.
- OO in One Sentence by A. Hunt and D. Thomas
- Open Closed Principle by R. Martin
- Code Smells by K. Beck and M. Fowler
Deliverables
- Thursday, September 9. Code review (one submission per team)
- In about two pages, describe the strengths and shortcomings of the program as specifically as possible
- To help focus your analysis, consider the following questions
- What specific pieces of code help versus obscure your understanding?
- What, if any, comments might be helpful within the code?
- What, if any, additional functions may be helpful?
- What, if any, classes may be helpful?
- Describe any resources you used to learn about the parts of the code you did not understand
- Explain how easy (or difficult) you think it will be to update the game to use your game engine
- Sunday, September 12. Game refactoring (one submission per team)
- A final version of your team's improved game, converted to use your game engine
- A description of how you would implement the other improvements in the game
- Monday, September 13. Postmortem (one submission per team)
- In about a page, discuss specifically how your refactorings made it easier for you to understand and extend the game
- In another paragraph, describe how your game engine helped (or hurt) making this game
- Finally, rate your game engine again - specifically how it supported making this kind of game