I have a method caller addColisionBox and when i call it and setting values to it i get nullpointer at the place im calling it.. I will show some code:
public void addCollisionBox(int x, int y, int arrayNum)
{
//Creating a new rectangle at the x & y cord passed in
rectangle[arrayNum] = new Rectangle(x, y, R_Width, R_Height);
}
And i created inside another class like this:
CollisionHandler collision;
....
//CurrentX and CurrentY position to pass into addCollisionBox method and at the array number i
collision.addCollisionBox(currentX, currentY, i);
And it says in a message box that Visual C# express give out that: "Object reference not set to an instance of an object."
NullReferenceException, which is the functional equivalent ofNullPointerExceptionin Java.