130 likes | 242 Views
Chapter 1. XNA Game Studio 4.0. Your First Project. A computer game is not just a program—it is also lots of other bits and pieces that make playing the game fun and interesting. C ontent Manager Comprehensive solution that manages XNA resources Part of the project .
E N D
Chapter 1 XNA Game Studio 4.0
Your First Project • A computer game is not just a program—it is also lots of other bits and pieces that make playing the game fun and interesting. • Content Manager • Comprehensive solution that manages XNA resources • Part of the project
Create Your First Project • In XNA Game Studio, select New Project from the File menu.
Create Your First Project • Select Windows Game.
Running Your First Program • Click the Start Debugging button
What Happens? • XNA Game Studio compiles the source code files. • The source code of the program is all the lines of C# code. • A compileris a program that takes source code and creates a set of machine instructions that can be loaded into the computer’s processor to control what the computer does • The compiler rejects any program that it thinks is not correct and tells you about the compilation errors. • If all the program source files compile correctly, they are then combined with any resources (for example, images and sounds) that are part of the project.
What Happens? • If you are using an external device, either Xbox 360 or Windows Phone, the compiled files are now transferred into it. • XNA Game Studio starts the program running.
Stopping a Program There are two ways to do this. • You can press the Back button on an Xbox 360 gamepad or Windows Phone to instruct the program to finish. If the program is running on a remote device, XNA Game Studio displays a message indicating that the remote connection to the device has been lost. Simply click OK on the message to dismiss it. • You can stop the program from within XNA Game Studio by clicking the Stop button
Storing Games on the Xbox 360 or Windows Phone • Once you’ve created a game and deployed it to an Xbox 360 or Windows Phone, the game itself remains stored inside the machine for you to load and play later, without the need for a PC to be attached. • You can find the games you have created by selecting your Game Library on the Xbox 360 or entering the Xbox Live Games menu on the Windows Phone.
Running the Same XNA Game on Different Devices • You can use a single XNA workspace to hold multiple projects, one for each device you want to target. • You will find out more about projects and workspaces in the section “XNA Game Studio Solutions and Projects” in Chapter 4.
Creating a Copy of an XNA Project for Another Device • Start by clicking the project in the Solution Explorer of XNA Game Studio so that it is selected. Then choose Create Copy Of Project For Xbox 360 from the Project menu.
Creating a Copy of an XNA Project for Another Device • XNA Game Studio copies the project and adds the copy to the workspace. • You can select which of the projects to start by setting one of the projects as the StartUp Project. • To set a project as the StartUp project, you right-click the project and choose Set as StartUp Project from the menu that appears • When you click Start Debugging, the project that is selected as the StartUp project is the one that gets to run.
Choosing Between Windows Phone and Emulator • If you have created a game that is aimed at the Windows Phone device you can select whether the game runs on the Windows Phone itself or the emulator. • To deploy to the device it must have been registered as a development device. • The phone must be connected to the computer via USB and the Zune software must be running. • The phone should not be displaying its lock screen when you try to deploy the program to it.