Richard G Baldwin (512) 223-4758, NRG Room 4238, Baldwin@DickBaldwin.com, http://www.austincc.edu/baldwin

GAME 1343 Game and Simulation Programming I:C#

This material applies to classroom sections and Open Campus (PCM) sections taught by Professor Baldwin.

Lab Projects

Fall 2013

Revised 03/10/13

The official web page for this course is GAME 1343


No suitable graphics card found

If Visual C# 2010 on your home computer complains about your graphic card, you may need to select the "Reach" profile.

See http://blogs.msdn.com/b/shawnhar/archive/2010/07/19/selecting-reach-vs-hidef.aspx

This often happens on computers with older graphics cards.

Summary:

Selecting Reach vs. HiDef

When you create a Windows Phone game project, XNA defaults to Reach profile. When you create a Windows or Xbox 360 project, it defaults to HiDef. But it is also possible to target Reach from a Windows or Xbox game! There are two reasons you might want to do this:

To use Reach on Windows or Xbox:

Laboratory Software

The following required software will be provided in the Game Programming lab (room 3136) at NRG.

Microsoft XNA Game Studio 4.0 integrated into Microsoft Visual C# Express Edition.

My version of the lab projects

When appropriate, I will provide a zip file for the project containing my version of the project along with any image and/or sound files required by my version. (Note that my version was written with XNA version 3.x. Updates required for compatibility with version 4.0 will be explained in the classroom.)

You should be able to extract the contents of the zip file into a folder and double-click on the exe file to run my version of the program. Be sure to use your headphones or speakers to listen for any sounds that might be produced by my version of each program.

Examples only

You should think of my programs simply as examples of the kinds of things that I expect from you. I don't expect you to replicate my program. I would prefer to see you go off on your own, be creative, and write programs that are different from mine. Just make certain that you can explain how your version satisfies the written specifications.

A caution on schedule

The schedule in the syllabus shows a project due approximately every other week (more frequently in the summer). Please note, however, that Project #8, which counts for twenty-percent of your final grade, will probably represent a major programming effort on your part. Be sure to complete the first seven projects sufficiently early to allow yourself plenty of time to complete Project #8.

 

Lab Project #1 - Familiarization with Visual C# Express Edition

The purpose of this project is to demonstrate that you are familiar with, and know how to use Visual C# Express Edition, which I will refer to herein as VCSEE.

Using VCSEE, create a Visual C# Console Application named Proj01 that displays your name on the console screen.

Your name must remain on the console screen until you purposely dismiss it.

Store the project on storage media that is allocated to you such as your H-Drive, a flash drive, a USB disk, etc.

Copy the "Release" folder from the project folder to another location on your disk and demonstrate to your instructor that you know how to execute your program from the command prompt.

Download a zip file containing a copy of my version of the project.

Lab Project #2 - Encapsulation of data

Using VCSEE, create a Visual C# Console Application named Proj02 that meets the following specifications:

Define a public class in your project named Proj02A. Cause the class to have one public property named First and a second public property named Last.

Instantiate a new object of the Proj02A class in your Main method. Use that object to store your first and last names.

Write code to use the object of the Proj02A class to cause your program to produce the following output on the console screen. Substitute your name for mine.

Output from Proj02
Enter your first name
Dick
Enter your last name
Baldwin

Your name is:
Dick Baldwin

Cause the text to remain on the console screen until you purposely dismiss it.

Copy the "Release" folder from the project folder to another location on your disk and demonstrate to your instructor that you know how to execute your program from the command prompt.

Download a zip file containing a copy of my version of the project.

Lab Project #3 - OOP Concepts

Using VCSEE, create a Visual C# Console Application named Proj03 that meets the following specifications:

Begin with the following definition for the class named Program.:

This class is given.
using System;

namespace Proj03 {
  class Program {
    static void Main(string[] args) {
      bool var1 = true;
      int var2 = 3;
      Console.WriteLine(new MyClass(var1));
      Console.WriteLine(new MyClass(var2));
      Console.WriteLine("Press any key to terminate.");
      Console.ReadKey();
    }//end main
  }//end class Program
}//end namespace

Without modifying the class named Program, expand the project as necessary to produce the following output on the command-line screen.

Required text output.
Display your first name here
Display your last name here
Press any key to terminate.

 

Lab Project #4 - Your first XNA project

Using a single image file of your choice, write an XNA game program that demonstrates that you know how to do the following:

The following image shows my version of the output from this program. As you can see, my image file has a X defined by pixels with a zero alpha value.

Missing Image xnaproj04.jpg

Note that the overall size of the image was reduced relative to the normal size of the game window in order to force it to fit into this narrow publication format.

(Note that you may need to search the web to find an image file with transparent areas defined by a very low alpha value. The JPEG format does not support alpa transparency, so your best bet may be a png file.)

 

Lab Project #5

Write an XNA project of your choice that demonstrates that you know how to do the following:

 

Lab Project #6

Write an XNA project of your choice that demonstrates that you know how to do the following:

 

Lab Project #7

Write an XNA project of your choice that demonstrates that you know how to do the following:

 

Lab Project #8

Write an object-oriented graphical 2D (optionally 3D if you know how) game program of your own design and be prepared to demonstrate it to the class. (The game concept need not be original. Feel free to replicate a game written by someone else in a different programming language.)

Try to make all of the elements in the game to be objects of classes that you design, or classes that you obtain from others.

In addition to the screen that is visible while the player is in the midst of the action, your program must also provide informational screens similar to the images shown in Figure 99 and Figure 100.

Figure 99. Startup screen.
Startup screen

Figure 100. Level transition screen.
Level transition screen

Your game must incorporate background images and have two or more visual objects moving in front of the background during game play.

Your game must make effective use of sounds and/or music along with player input using both the keyboard and the mouse.

Your game must incorporate movement of the visual objects in the game along with collision detection among the visual objects.

Your game must also provide two different Game Over screens, one for players who win and a different one for players who lose.

Your game must allow the player to progress through multiple levels with game play at each level being more difficult than game play at the previous levels.

-end-

File: GAME1343LabProjects.htm