- What Is the XNA Framework?
- Installing Visual C# 2008 Express
- Installing the DirectX Runtime
- Installing XNA Game Studio
- Creating the Platformer Projects
- Compiling and Running Platformer
- Summary
Installing Visual C# 2008 Express
To get started, you must have the software installed. Let’s start by installing Visual C# 2008 Express.
XNA requires C# due to how the Content Pipeline is used. Some people have successfully created demos using other languages, such as VB.NET and even F#. However, this is not currently supported by Microsoft and won’t be discussed in this book. This book assumes you have a good understanding of C#. If you know C++, Java, or VB.NET, you should be able to pick up C# pretty quickly.
I provide detailed steps to make sure anyone who has not worked with Visual C# Express will be able to get it installed with no issues. Feel free to skip this section if you already have a Visual Studio 2008 SKU installed.
To install Visual C# 2008 Express, follow these steps:
- You will need to be connected to the Internet to install the application. The application can be downloaded by browsing to http://www.microsoft.com/express/download/ and clicking the Visual C# 2008 Express Edition Download link to download and run the vcssetup.exe setup program.
- Optional. On the Welcome to Setup screen, select the check box to send data about your setup experience to Microsoft. This way, if something goes awry, Microsoft can get the data and try to make the experience better the next time around. This screen is shown in Figure 1.1.
Figure 1.1 Select the check box if you want the system to provide feedback to Microsoft about your installation experience.
- Click Next to continue.
- The next screen is the End-User License Agreement. If you accept the terms, select the check box and click Next.
- The following screen, shown in Figure 1.2, has two installation options you can check. Neither of these options is required to utilize XNA Game Studio.
Figure 1.2 Neither of these options is required to utilize XNA Game Studio.
- Click Next to continue.
- The next screen, shown in Figure 1.3, asks where we would like to install Visual C# Express. Note that other required applications, including Microsoft .NET Framework 3.5, will be installed. This is required because C# runs on the .NET Framework. You will also notice it requires more than 300MB of space.
Figure 1.3 Specify in which directory you want Visual C# Express to be installed.
- Click Next to continue.
- Now you are looking at the Installation Progress screen, where you can monitor the progress of the installation.
- On the Setup Complete screen, you can see the Microsoft Update link. Click it to get any of the latest service packs for Visual C# Express.
- Click Exit to complete the installation.
You have now successfully installed the first piece of the pie to start creating excellent games with XNA! Before we continue to the next piece of software, you need to open up Visual C# Express. It might take a couple of minutes to launch the first time the application is loaded. Once the Visual C# Express is loaded, you should see the Start Page, shown in Figure 1.4.
Figure 1.4 This is the Start Page inside of Visual C# Express.
The following procedure is optional, but it does ensure that everything is working correctly on your machine:
- In the Recent Projects section, find Create Project and click the link. You can also create a new project under the File menu.
- Visual C# Express installed several default templates that you can choose from. Select the Windows Application template, as displayed in Figure 1.5.
Figure 1.5 The New Project dialog box allows you to choose from the default templates to create an application.
- You can leave the name set to WindowsFormsApplication1 because you will just be discarding this project when we are done.
- Click OK to create the application.
- At this point a new project should have been created, and you should be looking at a blank Windows Form called Form1.
- Press Ctrl+F5 or click Start Without Debugging on the Debug menu.
If everything compiled correctly, the form you just saw in design mode should actually be running. Granted, it doesn’t do anything, but it does prove that you can compile and run C# through Visual C# Express. The end result can be seen in Figure 1.6. Close down the application you just created as well as Visual C# Express. Feel free to discard the application.
Figure 1.6 A C# Windows Form application after the default template has been compiled and run.