//End of potion purchases ---------->>>>>>> // to re-Open directions private void directionsBtn_Click(object sender, EventArgs e) { Directions directions = new Directions(); directions.Show(); directions.BringToFront(); }
public Adventure() { InitializeComponent(); // array of game locations gameMap[0, 0] = new Location(2, "Bed", "The bed where you sleep."); gameMap[0, 1] = new Location(1, "Home", "This is your home."); gameMap[0, 2] = new Location(3, "Window", "You see your field outside."); gameMap[1, 0] = new Location(6, "Well", "The well water is refreshing."); gameMap[1, 1] = new Location(4, "Field", "A field in front of your house."); gameMap[1, 2] = new Location(5, "Shed", "A place to keep your weapons."); gameMap[2, 0] = new Location(13, "Field", "Nothing this way."); gameMap[2, 1] = new Location(7, "Dungeon Entrance", "You can hear something coming from the cave."); gameMap[2, 2] = new Location(14, "Field", "Nothing this way."); gameMap[3, 0] = new Location(9, "Blocked Path", "There has been a cave in here."); gameMap[3, 1] = new Location(8, "Dungeon Room", "You can see the exit from here."); gameMap[3, 2] = new Location(10, "Locked Door", "A locked door"); gameMap[4, 0] = new Location(12, "Wall", "Nothing this way."); gameMap[4, 1] = new Location(11, "Treasure Room", "There is a treasure box here."); gameMap[4, 2] = new Location(12, "Wall", "Nothing this way."); // set current location for game start currentLocation = gameMap[0, 1]; // an array of monster images to display when monsters appear monsterImage[0] = TextAdventure_AllieBeckman.Properties.Resources.imp; monsterImage[1] = TextAdventure_AllieBeckman.Properties.Resources.goblin; monsterImage[2] = TextAdventure_AllieBeckman.Properties.Resources.troll; // set current array index ints x = 0; y = 1; selectionIndex = 0; // display current location to screen gameDisplay(currentLocation); // monster is not present right away isMonster = false; // monster isn't killed yet monstKilled = 0; // set players auto magic and weapon choice magic = new Magic("fire"); // show directions directions.Show(); // make the enter button on the keyboard click the enter button on my screen this.AcceptButton = enterButton; // first choice of char characterChoice(); }
public Adventure() { InitializeComponent(); // array of game locations gameMap[0, 0] = new Location(2, "Bed", "The bed where you sleep.", 0); gameMap[0, 1] = new Location(1, "Home", "This is your home.", 5); gameMap[0, 2] = new Location(3, "Window", "You see your field outside.", 6); gameMap[1, 0] = new Location(6, "Well", "The well water is refreshing.", 1); gameMap[1, 1] = new Location(4, "Field", "A field in front of your house.", 4); gameMap[1, 2] = new Location(5, "Shed", "A place to keep your weapons.", 0); gameMap[2, 0] = new Location(13, "Field", "Nothing this way.", 0); gameMap[2, 1] = new Location(7, "Dungeon Entrance", "You can hear something coming from the cave.", 0); gameMap[2, 2] = new Location(14, "Field", "Nothing this way.", 0); gameMap[3, 0] = new Location(9, "Blocked Path", "There has been a cave in here.", 0); gameMap[3, 1] = new Location(8, "Dungeon Room", "You can see the exit from here.", 0); gameMap[3, 2] = new Location(10, "Locked Door", "A locked door", 0); gameMap[3, 3] = new Location(15, "Dungeon Stairs", "Go down the stairs?", 0); gameMap[3, 4] = new Location(16, "Basement", "It's dark and cold here", 0); gameMap[3, 5] = new Location(17, "Basement Hall", "Theres a small light ahead,", 2); gameMap[3, 6] = new Location(18, "Dungeon Center", "There are so many hallways connecting here!", 0); gameMap[4, 0] = new Location(12, "Wall", "Nothing this way.", 0); gameMap[4, 1] = new Location(11, "Treasure Room", "There is a treasure box here.", 0); gameMap[4, 2] = new Location(12, "Wall", "Nothing this way.", 3); // set current location for game start currentLocation = gameMap[0, 1]; // an array of monster images to display when monsters appear monsterImage[0] = TextAdventure_AllieBeckman.Properties.Resources.imp; monsterImage[1] = TextAdventure_AllieBeckman.Properties.Resources.goblin; monsterImage[2] = TextAdventure_AllieBeckman.Properties.Resources.troll; monsterImage[3] = TextAdventure_AllieBeckman.Properties.Resources.demon; // set currentLocation array index ints x = 0; y = 1; selectionIndex = 0; // an array of items for this game item[0] = new Item(1, "Health Potion", "A potion to restore health."); item[1] = new Item(2, "Mana Potion", "A potion to restore mana."); item[2] = new Item(3, "Key", "A metal object used to unlock doors."); item[3] = new Item(4, "Stone of Strength", "A small stone in the shape of a sword. You feel stronger when you hold it."); item[4] = new Item(5, "Stone of Magic", "A small blue stone. You feel magical energy flowing from it."); item[5] = new Item(6, "Stone of Protection", "A small stone with a shield carved into it. You feel more alive holding it."); // display current location to screen gameDisplay(currentLocation); // monster is not present right away isMonster = false; // monster isn't killed yet monstKilled = 0; //number of monsters killed monsterKillCount = 0; // set players auto magic and weapon choice magic = new Magic("fire"); // show directions directions.Show(); // make the enter button on the keyboard click the enter button on my screen this.AcceptButton = enterButton; // first choice of char characterChoice(); // starting out you do not have a key hasKey = false; doorIsOpen = false; }