First we need to download the required software to run our compiler.
Install by following the on screen instructions.
Now, run Visual C# 2010 Express and start a new project, select XNA Game Studio 4.0, name your project, and click ok.
Your screen should look similar to this:

As we start programing I will explain what everything here means but for now lets edit our code.
Scroll down to the draw method and change
to
GraphicsDevice - is the link from your code to your graphics card.
.Clear - is erasing everything on the screen
(Color.Green) - Setting the screen to the color green.
Scroll up to the "Initialize()" method
add the following lines above base.Initialize
The first two lines set our window's height and width while the third declares if it is full screen, the fourth line is applying the changes that we requested above. The last line is naming the window in which the game is displayed.
Debug your game and it should look like this:

If you have any questions or problems please post them. This is very simple but it will become more complicated soon. Don't forget to thank!
- XNA Game Studio Here
- Visual Studio C# 2010 Express Here(Select Visual C# 2010 Express and pick your language)
Install by following the on screen instructions.
Now, run Visual C# 2010 Express and start a new project, select XNA Game Studio 4.0, name your project, and click ok.
Your screen should look similar to this:
| This image has been resized. Click this bar to view the full image. The original image is sized 1920x1050. |

As we start programing I will explain what everything here means but for now lets edit our code.
Scroll down to the draw method and change
Code:
GraphicsDevice.Clear(Color.CornflowerBlue);
Code:
GraphicsDevice.Clear(Color.Green);
.Clear - is erasing everything on the screen
(Color.Green) - Setting the screen to the color green.
Scroll up to the "Initialize()" method
add the following lines above base.Initialize
Code:
graphics.PreferredBackBufferHeight = 500; graphics.PreferredBackBufferWidth = 500; graphics.IsFullScreen = false; graphics.ApplyChanges(); Window.Title = "First 2D Game";
Debug your game and it should look like this:

If you have any questions or problems please post them. This is very simple but it will become more complicated soon. Don't forget to thank!



0 komentar:
Post a Comment