Quantcast
Channel: Stack2RSS Custom Feed
Viewing all articles
Browse latest Browse all 11992

C# loading image error - PLEASE HELP ANYONE!

$
0
0
Answers: 0
Accepted answer: no

The Problem is with the "square" image

Hey, I'm trying to load an image into my 2D game but there is an error, "NullReferenceExeption was unhandled" then under it says "Object reference not set to an instance of an object."

Please help I've been stuck on this for a while. I have all the references correctally labeled and also the player class

protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice);

        backGround = Content.Load<Texture2D>("Cracked");


        player1.playerBlock = Content.Load<Texture2D>("square");

        player2.playerBlock = Content.Load<Texture2D>("square2");
    }

Viewing all articles
Browse latest Browse all 11992

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>