I am using the XNA framework to make one of my first games. In it's main game class (Breakout.cs
), I put this:
public int screenHeight;
public int screenWidth;
And in the Initialize
method:
this.screenHeight = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height;
this.screenWidth = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width;
But when I try and access it from my Paddle
class I get this error:
The name 'screenWidth' does not exist in the current context
I always thought that setting a variable to public would make it accessible any where?
Help is appreciated, thanks.