Results 1 to 1 of 1
  1. #1
    richdude212's Avatar
    Join Date
    Jun 2009
    Gender
    male
    Location
    Tampa, FL
    Posts
    352
    Reputation
    10
    Thanks
    56
    My Mood
    Inspired

    [XNA] Developing Your First 2D Game Tutorial: Part 1

    First we need to download the required software to run our compiler.
    • 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:


    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);
    to
    Code:
    GraphicsDevice.Clear(Color.Green);
    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
    Code:
     
    graphics.PreferredBackBufferHeight = 500;
    graphics.PreferredBackBufferWidth = 500;
    graphics.IsFullScreen = false;
    graphics.ApplyChanges();
    Window.Title = "First 2D Game";
    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!
    [IMG]https://i516.photobucke*****m/albums/u330/richdude212-2.jpg[/IMG]


    [IMG]https://i516.photobucke*****m/albums/u330/richdude212/leet.gif[/IMG]

    Get NX Cash For Completing Offers Here! (will redirect)


    Remember to press when people help you!
    Not bad for $14.99 a month...

  2. The Following 2 Users Say Thank You to richdude212 For This Useful Post:

    DoubleCodes (05-24-2011),unRealize (09-11-2011)