CSCE 2014 - Homework 1
Due Date - 01/30/2014 at 11:59 PM

1. Problem Statement:

The goal of this programming assignment is to create data structures to store information about the players in a first person shooter game. Specifically, your task is to create a "Player" class that stores information about the player, and contains several methods for implementing typical actions in a video game. Obviously, we will not be able to implement the whole user interface and graphics for the game, so your main program will be a simple function that lets you call the methods in the Player class, and print out the player information.

2. Design:

Create a C++ class called "Player" that contains FIVE or more data fields that describe the player's current status in the game. For example, their name, their current (x,y) location in the game, their current armor, their health level, what weapon and how much ammo they have. It is up to you to decide on the names and data types that are appropriate.

Create the default constructor, get/set methods, a print method, and FIVE additional methods that make sense for the game. For example, when a player dies, they often spawn in a new location with default armor/weapon and full health. When a player is shot by different weapons, their health goes down based on their current armor and their opponent's weapon. The goal here is not to recreate every action possible in a full video game, all we want is some methods that demonstrate your understanding of object oriented design.

Finally, write a main program to test the creation of your Player object and all of the methods you created above. You can do this with a simple menu-based interface or you can "hard code" a sequence of calls that demonstrates that everything works as intended.

3. Implementation:

You can implement this program using either a bottom-up approach or a top-down approach. If you go for a bottom-up approach, start by creating basic methods and classes, and test theses methods using a simple main program that calls each method. When this is working, you can create the main program that uses these methods to solve the problem above.

If you go for a top-down approach, start by creating your main program that reads user input, and calls empty methods to pretend to solve the problem. Then add in the code for these methods one at a time. This way, you will get an idea of how the whole program will work before you dive into the details of implementing each method and class.

Regardless of which technique you choose to use, you should always develop your code incrementally adding code, compiling, debugging, a little bit at a time. This way, you always have a program that "does something" even if it is not complete. Also, remember to keep backup versions of your code, so you always have a version to fall back on if you accidentally delete your code or your changes do not work out.

4. Testing:

Test your program to check that it operates correctly for all of the requirements listed above. Also check for the error handling capabilities of the code. You are required to include your testing results in your project report to demonstrate that your program works correctly. To do this use the "script" command to save all program input/output in a "typescript" file, and cut and paste from this ascii file into your program documentation.

5. Documentation:

When you have completed your C++ program, use the "Programming Report Template" on the class website to document your programming project. This report has separate sections to describe the problem statement, your design decisions, your implementation process, and your testing results. Each of these sections should be 1-2 paragraphs long, so your completed report will be 2-3 pages long once you have included your testing output.

6. Project Submission:

In this class, we will be using electronic project submission to make sure that all students hand their programming projects and labs on time, and to perform automatic analysis of all programs that are submitted. When you have completed the tasks above go to the class web site to "Upload" your documentation (a single docx file), and your C++ program (a single ascii text file).

The dates on your electronic submission will be used to verify that you met the due date above. All late projects will receive reduced credit:

You will receive partial credit for all programs that compile even if they do not meet all program requirements, so handing projects in on time is highly recommended.