Game Development Reference
In-Depth Information
Fig. 1.5 An overview of the
files in the basic windows
game project
Fig. 1.6
Changing the background color of the main game window
window, you'll see a panel called 'Solution Explorer', that contains a tree structure
of files (see Fig. 1.5 ). The project you created is written in boldface and you can
see a number of files below it. Double-click on the file Game1.cs . You'll see that
the file is a text file, and that we can now edit it. This file contains all the code to
run the simple program that we've just executed. Try and modify this code a little
bit. For example, you see the following line of code almost at the bottom of the
program:
GraphicsDevice.Clear(Color.CornflowerBlue);
Now, change this line into the following line:
GraphicsDevice.Clear(Color.Chocolate);
Run the program again by pressing the green play button. The color in the window
has now changed! Instead of Chocolate you can write a lot of different colors, such
as AntiqueWhite , Olive , Black , and much more. Remove the .Chocolate from the line
and enter a dot after the word Color , but before the closing parenthesis. You now see
that the editor shows a list of all possible colors (see also Fig. 1.6 ). This is a very
nice feature of the editor that works not only for colors, but for a lot of other aspects
of creating programs.
Search WWH ::




Custom Search