Hi,
So I'm making my final project for my CS class. I'm making a pokemon game.
So right now I'm trying to input information(The pokemon the player has) into my array of objects(The list of pokemon the player has). I have the array in a global class so every form can access it. I have it declared as;
but when I try to input something to that array with;
GlobalVariables .PlayerPokemonL ist[0].Name = "BULBASAUR" ;
It says the object is null. I've tried to declare the array under the initilizer in the form but it doesn't work, I tried it like this;
I have also tried to put it under Public Partial Class, but it doesnt work
Any help would be greatly appreciated
So I'm making my final project for my CS class. I'm making a pokemon game.
So right now I'm trying to input information(The pokemon the player has) into my array of objects(The list of pokemon the player has). I have the array in a global class so every form can access it. I have it declared as;
Code:
public class GlobalVariables
{
public static PlayerPokemon[] PlayerPokemonList = new PlayerPokemon[5];
}
GlobalVariables .PlayerPokemonL ist[0].Name = "BULBASAUR" ;
It says the object is null. I've tried to declare the array under the initilizer in the form but it doesn't work, I tried it like this;
Code:
public IntroForm()
{
InitializeComponent();
GlobalVariables.PlayerPokemonList[] PlayerList = new GlobalVariables.PlayerPokemonList[];
}
Any help would be greatly appreciated
Comment