CS183 -- Project 1: Individual Design Project



->Courses
->CS183
-->Objectives
-->Quiz 1
-->Lab 1
-->Lab 2
->Project 1
-->Project 2
->Electronic Submission
->Old Exams
->C++ Examples
->MSVC++ Info
->STL Info
->MFC/GUI Info
->Software
->Tentative Schedule
->Support Forum
->Course Policies

[Courses]
[Rich][Home][Rich]
[PHome]

Spring Quarter 2003

Course Objectives Addressed

  • Understand the rationale for object-oriented design and programming.
  • Understand data abstraction and abstract data types.
  • Be familiar with UML class notation and use cases.
  • Be familiar with composition, inheritance, polymorphism, and C++ templates.
  • Be able to design and implement simple C++ classes and class libraries.
  • Be able to design small software systems using classification and use cases.
  • Be able to document the design and implementation of small software systems.

Overview

The purpose of this project is to develop a simple computer game.

Video Introduction (requires MS Media Player 7 or higher)

Acknowledgement

This project was inspired by the game "Chain Shot", written by Kuniaki Moribe in 1985. In 1992 Eiji Fukumoto rewrote the game and gave it its more common title, "Same Game." This assignment was developed by Dr. Chris Taylor.

Important Note

Source code for a number of implementations of this assignment are freely available on the web. You may look at the applications to get an idea of how the game works, but you MAY NOT LOOK AT THE SOURCE CODE for any of these implementations until AFTER you have submitted your final report.

Problem Statement

You and one partner are to write a version of the Same Game.

Game board

The game consists of a multi-colored tiled board. The board should be at least ten tiles high and twenty tiles wide and should have at least four unique tile colors.

Game play

Same Game is a one player game. The player removes tiles from the board by selecting a tile that has at least one adjacent (to the west, east, north or south) of the same color. The first click selects a group of adjacent tiles. The second click on the selected group of tiles will remove the tiles from the board. This causes the tiles to the north to shift south and tiles to the west to shift east to file the space left by the removed tiles (all southerly shifts should occur before any westerly shifts).

Game scoring

When a player removes a group of N same-colored blocks, the player's score increases by (N-2)2 points. When play has progressed to the point where there are no groups left (only single colored blocks remain), the game should end. The player's final score should be reduced by one point for each remaining block. If no blocks remain, the final score should be increased by five times the number of tiles on the full board.

Game extras

Although not required, you may choose to incorporate additional features. These may include a high score list, resizable board, selectable number of colors for the blocks, hint feature, undo, sound, make it a two player game where players alternate turns, etc...

Here are a few sites that offer versions of the game. Remember, you may not look at the source code for these implementations until after you have submitted your final report.

Design

Your design should consist of an annotated UML class diagram (see my useful software page for a tool to draw UML diagrams) expressing your high level design, a verbal description of how your objects/functions will interact, and at least one use case for your software project.

Hints

You will need to store the grid of game pieces in your program. One way to do this would be to make each button be an MFC button. When a button is clicked a function would be called that will need to figure out if it is a valid move and if so, which pieces to remove and then shift the other pieces south and west. The following is a pseudocode function that is designed to give you an idea about how to tackle the problem of figuring out which game pieces should be removed.

function(i, j, count, clr) {
  if(color of (i,j) == clr) {
    increment count
    flag piece as one to be removed

    // Calls the function on the neighboring pieces
    function(i-1,   j, count, clr)
    function(  i, j-1, count, clr)
    function(i+1,   j, count, clr)
    function(  i, j+1, count, clr)
  }
}

The removing and shifting of game pieces may be done by recoloring the buttons. You may find my MFC Button Coloring example useful.

Dr. Rothe has developed this button framework that you may wish to use, and short Video explanation (requires MS Media Player 7 or higher)

Lab report

There should be one lab report for each pair of students. The report should consist of the following:

  • Your design documentation. (You may include images (in .png format) of scans of hand drawn UML diagrams and sequence diagrams if needed.)
  • A brief description of any problems you encountered or questions you have regarding the lab.
  • Any suggestions you have for how the lab could be improved.
  • Your individual activity logs and a summary of your activity logs indicating how much time you spent on the assignment. Please follow the time log format given in the template file. In particular, you should record the date and time for each block of time you work on the project. Please report the time in the following categories:
    • Designing
    • Coding
    • Debugging (before you think it's working)
    • Testing (after you think it's working)
    • Writing report
    • Other
  • The documented source code for your program. Include only the source files that you modified.

Deliverables

  • Due: 11pm Friday of weeks 5, 6, and 7: Activity log
  • Due: 11pm day prior to week 8 lab: Final report (should include all previously submitted material)

Project report template

As with any report you submit, correct spelling and grammar are required. In addition, your report should be submitted electronically following the Electronic submission guidelines. (You may wish to consult the sample report before submitting your report.) Be sure to keep copies of all your files, in case something gets lost.

Your lab grade will be determined by the following factors:

  • Meeting specifications
  • Technical quality
  • Design documentation
  • Internal documentation (comments)
  • Program clarity (formatting, etc.)
  • Narrative report
  • Activity logs
  • Correct program results
  • Spelling and grammar
  • Timeliness of submissions

If you have any questions, consult your instructor.

© 2002-2003 Dr. Christopher C. Taylor Office: CC-27C Phone: 277-7339 Last Updated: Tue Apr 15 18:04:14 2003
I am responsible for all content posted on these pages; MSOE is welcome to share these opinions but may not want to.