I am making a small game in C# and I am trying to load images into an array, but it keeps saying the index is out of range.
Here's the part that is giving me an error:
Image[] Map = new Image[10]; Image map1 = Image.FromFile("_Maps_\\map1.png"); Map[1] = map1; Image map2 = Image.FromFile("_Maps_\\map2.png"); Map[1] = map2; Image map3 = Image.FromFile("_Maps_\\map3.png"); Map[1] = map3; Image map4 = Image.FromFile("_Maps_\\map4.png"); Map[1] = map4; Image map5 = Image.FromFile("_Maps_\\map5.png"); Map[1] = map5; Image map6 = Image.FromFile("_Maps_\\map6.png"); Map[1] = map6; Image map7 = Image.FromFile("_Maps_\\map7.png"); Map[1] = map7; Image map8 = Image.FromFile("_Maps_\\map8.png"); Map[1] = map8; Image map9 = Image.FromFile("_Maps_\\map9.png"); Map[1] = map9; Image map10 = Image.FromFile("_Maps_\\map10.png"); Map[1] = map10; I am a bit new to arrays in C#
If you need more code just ask