0
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace Space_Shooter
{


public class Game1 : Microsoft.Xna.Framework.Game
{
    GraphicsDeviceManager graphics;

    SpriteBatch spriteBatch;

    public Game1()
    {

        graphics.IsFullScreen = false;
        graphics.PreferredBackBufferWidth = 800;
        graphics.PreferredBackBufferHeight = 950;
        this.Window.Title = "XNA Space Shooter";

        graphics = new GraphicsDeviceManager(this);
        Content.RootDirectory = "Content";
    }


    protected override void Initialize()
    {


        base.Initialize();
    }


    protected override void LoadContent()
    {
        // Create a new SpriteBatch, which can be used to draw textures.
        spriteBatch = new SpriteBatch(GraphicsDevice);

        // TODO: use this.Content to load your game content here
    }


    protected override void UnloadContent()
    {

    }


    protected override void Update(GameTime gameTime)
    {

        if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
            this.Exit();



        base.Update(gameTime);
    }


    protected override void Draw(GameTime gameTime)
    {
        GraphicsDevice.Clear(Color.CornflowerBlue);



        base.Draw(gameTime);
    }
}
}

The Error is showing up on "graphics.isFullscreen = false;" and I have no idea what to do.. I think the code may be for an earlier XNA framework but I want to know how to fix this to work with the current XNA framework because that's the smarter thing to do so if there is someone who knows how to fix this then please tell me.. Also alot of this writing is because most of my post is code and it wont let me post it until I have more details so hopefully I don't have to write much more.. anyway someone please help!!!

Ben Robinson
  • 20,984
  • 5
  • 58
  • 76
Matthew Leman
  • 55
  • 1
  • 8

1 Answers1

0
public class Game1 : Microsoft.Xna.Framework.Game
{
GraphicsDeviceManager graphics;

SpriteBatch spriteBatch;

public Game1()
{

    graphics.IsFullScreen = false;
    graphics.PreferredBackBufferWidth = 800;
    graphics.PreferredBackBufferHeight = 950;
    this.Window.Title = "XNA Space Shooter";

    graphics = new GraphicsDeviceManager(this);
    Content.RootDirectory = "Content";
}

I am giving graphics a value after trying to set its values... I should have:

public class Game1 : Microsoft.Xna.Framework.Game
{
GraphicsDeviceManager graphics;

SpriteBatch spriteBatch;

public Game1()
{
    graphics = new GraphicsDeviceManager(this);
    graphics.IsFullScreen = false;
    graphics.PreferredBackBufferWidth = 800;
    graphics.PreferredBackBufferHeight = 950;
    this.Window.Title = "XNA Space Shooter";


    Content.RootDirectory = "Content";
}
Soner Gönül
  • 91,172
  • 101
  • 184
  • 324
Matthew Leman
  • 55
  • 1
  • 8