Project #3 - Puzzle Game - 15%
due by midnight, U Jan 29

Please read the class programming standards and the GUI testlist.

Deduction for lateness is 10% per day for 5 days, then no credit.  Start early!

version 1.1 , last updated 08/07/2006 - added slides on "states"

TurnRedDemo.zip (.zip of project from M Jan 23 class)
Please read this slideset (.zip of .ppt) about a way to view the states and analyze the behavior of the TurnRed program before you code it.

GRADING CRITERION:

  1. 75% correct execution
  2. 25% coding practices (maintainability etc.)

Using Microsoft Visual C#, write a puzzle game (download to a .NET machine, unzip and run the prototype).  NOTE: This executable, being a prototype, has not been properly stress-tested, and I don't promise that it won't break or that it implements all features you are asked to implement.

RULES:

  1. The puzzle should provide an Option in its menus to switch between small and large grids:
  2. Clicking a button causes it to toggle colors, as well as the four adjacent buttons (above, below, right and left).  If the clicked button is at the edge, there is no wrap-around.  The player's goal is to turn all squares red.
  3. Each button click increments the count of moves.
  4. The window must be not resizeable.  The About window should also not resize.
  5. The application should be self-contained; it should require no extra files to run.  That way, people can just drop the executable anywhere and run it.
  6. The game should tell you when you've won and should display how many moves were used to win.  It should use the caption area below the grid to do this (and, unlike my prototype, there should be NO popup upon winning).  After winning and before clicking "New Game", buttons in the grid should not toggle, and the caption background color should be yellow (or some brighter color than usual).
  7. STARTING A GAME: To set up for a "New Game", first set the entire grid to red, and then simulate a number of randomly-selected button clicks.  The more random clicks you make to start the game, the harder the puzzle is likely to be to solve.  Please use exactly 8 clicks for the 5x5 grid, and 19 for the 10x10 grid.
    NOTE: The random clicks do the same thing during game setup as during the game--they toggle the chosen button and its neighbors.  If you just toggle each button's color but not the neighbors, you risk ending up with an unwinnable game.
  8. When creating a new game configuration randomly, it is possible that the result will be an all-red grid; please detect this and repeat the set of random clicks until at least one square is not red.
  9. Please implement an Undo function that can retract moves all the way back to move 0, if desired.  You will likely want to use a Stack object to store button presses to facilitate undoing of moves later.  Each Undo menu click should decrement the count of moves and back the game up to where it was one move earlier.  NOTE: If you click the same button twice in a row, the second click reverses the effects of the first click.
  10. Disable the Undo menu when there are no moves to undo, or when a game has been won.
  11. At a single place in your code, you should be able to specify button size, number of rows, and number of columns for both grid sizes.  Your program should adapt the form size if those values are changed.  This means you must place the buttons on the form in code (and not using the Windows Forms Designer), and everything must resize itself appropriately when the main form loads.
  12. You should provide an About screen via the menus which displays (at least) your name and the program name and version.
  13. Please display the executable name and the short version number in the Window title and in the About menu (for example, the menu text might be "About turnred 2.2").
  14. You may choose your own icon, and you may wish to provide additional functionality, but be aware that it should work well (and be obvious) or you might lose points.  Extra credit is not guaranteed or promised for extra functionality.  NOTE: If you provide any sounds, the user must be able to turn the sounds off.
  15. Your game should refuse to run more than one copy of itself at the same time.
  16. Be aware of the effect of screen DPI
  17. Please check with me before changing any features of the game, including the exact wording of menus or names of things.

GOALS:

  1. To practice programming a (relatively simple) game in C#.
  2. To practice using a custom control added to a form by program code.
  3. To practice using a Stack object for Undo functionality.

GETTING HELP:
If you need help, try (in preferred order):


TURN-IN:
The turn-in procedure for programming assignments is as follows:

  1. Create a folder with your emailID as its name.  The folder I would create would be pgpalmer; yours will be different.  Place your Visual Studio solution and project, and all related files, into this folder.
  2. Test your copied program thoroughly to make sure it works.
  3. When fully tested, zip up the entire folder, including all files underneath the folder.  NOTE: Please do not use the "save full path info" option.
  4. Test unarchiving the zip file to make sure it produces all your files and directories, but in whatever folder the person unzipping chooses (such as, on the Desktop).
  5. If correct, log into Blackboard and turn in the zip file (via file upload in your web browser).  Be sure to select "Send File" (and not "Add File") in Blackboard's Drop Box.

Visitors: Hit Counter