Project #4 - CrazyFish - 15%
due midnight,
U Jul 16

Work in pairs (you choose partners).  Team gets one grade.

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

version 2.1, last updated 07/01/2006 - replaced starter code and my prototype with v2.0

This project is intended to be developed in pairs.  I require separate pre- and post- time estimates from each person.

GRADING CRITERION:

  1. 70% correct execution
  2. 15% coding practices (maintainability etc.)
  3. 10% documentation
  4. 3% - time pre-estimate
  5. 2% - time post-estimate (should not be identical to pre-)

Using Microsoft Visual C#, recreate the source code for Jeremy Pfund's lost CrazyFish program.  It was written several years ago, and Jeremy has lost the source code (no kidding); only the installer remains (see the RESOURCES section below).  Here is a screen shot of the original program:

RULES:

  1. You must implement normal swimming by the fish, such that it sometimes swims in front of, and sometimes behind, the sand castle.  Swimming should appear to be random, back and forth, up and down.
  2. Your program must implement feeding and, if fed three times, the program should allow the fish to blow up and explode as in the original program.
  3. Please implement all five ways of destroying the fish.  If any way is not yet implemented, buttons for unimplemented functions should be disabled.
  4. Your program must encapsulate all graphics used.  It should consist of a single executable that can be moved anywhere by itself.
  5. Your program must identify you in an About form.
  6. Your program should strive to be as much like the original as possible.  If you think you can improve on it's behavior, check with me first.  Please use the original graphics for this project.
  7. The form must be resizable and maximizable.  Settings such as sound on/off must be persistent.
  8. The sea must be displayed in a panel so that the buttons can appear on the form at the same time.  A starter project has been provided (see the RESOURCES section below).
  9. Your program must NOT use DirectX or any other third party control other than what comes built-in with VS.NET.
  10. Your program must implement sounds of your own choosing, in places of your own choosing, as part of each way of destroying the fish.  There should also be some kind of sound when the fish is just swimming around.  Sound must be able to be turned off as part of the program options.
  11. As with graphics, all sound files should be embedded in the executable file so that the .exe is standalone.
  12. Your images must be transparent when placed over each other.  I was unable to do this using the PictureBox control--one PictureBox was transparent against the panel, but not when overlaid with another PictureBox.  Thus I had to override the OnPaint event in the panel and write the code to draw each image, always setting its transparency to the color in pixel 1,1.  The image painted last is on top.

RESOURCES and SAMPLE CODE:

  1. Jeremy's installer will place the executable and graphics on your machine, but you will first need to make sure you have installed the VB6 and DirectX runtimes. You may need to run three installers (with possible reboot needed each time):

    1. vbrun60sp6.exe (Visual Basic 6.0 Run-Time installer)
    2. dxwebsetup.zip (DirectX 9.0c End-User Runtime installer)
    3. CrazyFish.zip (Jeremy's installer)
    If you already have a version of DirectX on your machine, you may be able to skip step 2 above.
  2. If you're unable or unwilling to install Jeremy's program, here's CrazyFishTheMovie.zip (.AVI of program being run--1 Mb download, 36 Mb expanded).
  3. Here are the original 27 bitmaps (.zip).  Here is an image reference sheet.
  4. Here is Ravi's prototype and Pat's incomplete prototype (v2.0).  Ravi's does not use a panel as required by Rule 8; he has provided shock (press ‘s’), laser (press ‘l’), and feed (press 'f')per his readme file.
  5. You may use this starter project (.zip of v 2.0) that paints water and sand in the panel, double buffers for smooth motion, and can be resized and maximized:

    You will use a timer in the panel to cause movement; the timer handler should merely call the panel's Invalidate method, which will cause the panel to redraw.  Any painting is then done by overriding the panel's OnPaint() event handler.  OnPaint() first calls its base class to do any default painting needed for the panel; then you can use the graphics object sent to OnPaint() as an input parameter to do any additional drawing in the panel that you need to do.
  6. For GDI+ help, see these slides and code samples. See also the technical links page (scroll down to the "Managed GDI+" links from Microsoft).
  7. See this explanation of an alternate way to do double-buffering.
  8. To embed sounds (.wav files), follow the same procedure used to embed bitmaps using a resource file.  Here's a sample sound project.

GOALS:

  1. To practice using GDI+ graphics.
  2. To practice keeping complex program state and juggling of multimedia performance demands.

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


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

  1. Only one group member should turn in a zipped folder with: a) the zipped Windows application, b) a readme file and time pre- and post-estimates for both people.
  2. Create a folder with your combined PennNetID1_PennNetID2 as its name (for example, "pgpalmer_palmer".  Place all needed files (see preceding step) into this folder.
  3. Test unarchiving the zip file to make sure it produces all your files, but in whatever folder the person unzipping chooses (such as, on the Desktop).
  4. 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