Hi,
I have been using VB for around a year now and have picked it up relatively well, I wanted to try something new so have moved onto C#. I am working on creating a simple RPG to play with the language. I have created a class which is called PlayableCharacter which has a number of properties and a method which initialises the character (populates the stats of the character based on a class choice.
After this I have created an instance in a form called player1 and initialised a character (by inputting 2 arguments) as shown:
public PlayableCharacter player1; /* HERE IS THE CREATION OF Player1 (instance of playableCharacter)*/
public CharCreation()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void CmdInitChr_Click(object sender, EventArgs e)
{
player1.InitialiseCharacte
r(ChrNameT
xtBox.valu
e, ChrClassCmbBox.value);
Application.Run(new CharConfirmation());
now even though I have declared this instance when trying to use player1 in my second form it does not appear on the list? Im a complete beginner of C# as I literally only started using it for the first time yesterday so may not have a proper understanding.
Any help is greatly appreciated!
Craig
Start Free Trial