Hello I have a problem passing the constructor with argument of my class. There it is:
// Non-static variables exist once for each instance of the class
Vector2 position;
public Vector2 Position { get { return position; } }
public myClass(Vector2 position)
{
this.position = position;
}
I'm trying to instance it like this (Game1
class):
myClass myClassInstance;
protected override void Initialize()
{
// TODO: Add your initialization logic here.
myClassInstance = new myClass(Position);
base.Initialize();
}
But I get this error at Initialize()
:
Error 1 The name 'Position' does not exist in the current context