Exemplo n.º 1
0
 public MapObject()
 {
     _Cave = new Cave();
     setHazards();
     setPlayerLocation();
     setWumpusLocation();
 }
Exemplo n.º 2
0
        private void map5_Click(object sender, EventArgs e)
        {
            String path = @"C:\Users\pumpk\source\repos\HuntTheWumpus\HuntTheWumpus\bin\Debug\adrienneCave5.txt";
            Cave   cave = new Cave(path, "Cave 5");

            this.Hide();
            (new Game(cave)).Show();
        }
Exemplo n.º 3
0
        private void construct_objects_Click(object sender, EventArgs e)
        {
            Cave        cave      = new Cave();
            GameControl game      = new GameControl();
            HighScore   highScore = new HighScore(0);
            Trivia      trivia    = new Trivia();

            ui = new UI();
        }
Exemplo n.º 4
0
 public Game(Cave kave)
 {
     InitializeComponent();
     this.cave   = kave;
     this.scores = new HighScoreManagement();
     map         = new HuntTheWumpus.Map(2, 2, cave);
     game        = new GameControl();
     player      = new Player("Charlie", cave, map);
     sound       = new Sound();
     highscores  = new HighScores();
     updateConnections();
 }
Exemplo n.º 5
0
 public Player(String player, Cave cave, Map map)
 {
     //Constructor for a score object.
     //Will be called by Game Control
     this.map        = map;
     this.playerName = player;
     this.arrows     = 3;
     this.gold       = 0;
     this.goldMap    = 100;
     this.turns      = 0;
     this.score      = 130;
     this.cave       = cave;
     this.questions  = new Trivia();
 }
Exemplo n.º 6
0
 //Constructor for a Player object.
 //Will be called by Game Control to initialize a Player
 public Player(String player, Cave cave, Map map)
 {
     this.map          = map;
     this.playerName   = player;
     this.arrows       = 3;
     this.gold         = 0;
     this.goldMap      = 100;
     this.turns        = 0;
     this.score        = 130;
     this.cave         = cave;
     this.questions    = new Trivia();
     this.numRight     = 0;
     this.numQuestions = 0;
 }
Exemplo n.º 7
0
        //creates a map objec with two parameters, each containing the number of bats/caves we you need
        public Map(int bat, int ditch, Cave cave)
        {
            //gets all possible positions that one can move
            movement = cave.getCaveSystem();
            //visualizes the map
            rooms = new char[MAX];
            for (int i = 0; i < rooms.Length; i++)
            {
                rooms[i] = ' ';
            }
            batPos   = new int[bat];
            ditchPos = new int[ditch];
            //create random position for both palyer and wumpus
            playerPos        = rnd.Next(MIN, MAX);
            rooms[playerPos] = 'p';
            wumpusPos        = rnd.Next(MIN, MAX);
            //checks if they are the same, if so, re assign it another random value
            while (playerPos == wumpusPos)
            {
                wumpusPos = rnd.Next(MIN, MAX);
            }

            rooms[wumpusPos] = 'w';
            //create a for loop that sets the random values for each ditch and bat, and checks if they are the same
            for (int i = 0; i < batPos.Length; i++)
            {
                batPos[i] = rnd.Next(MIN, MAX);

                while (rooms[batPos[i]] != ' ')
                {
                    batPos[i] = rnd.Next(MIN, MAX);
                }

                rooms[batPos[i]] = 'b';
            }
            for (int i = 0; i < ditchPos.Length; i++)
            {
                ditchPos[i] = rnd.Next(MIN, MAX);
                while (rooms[ditchPos[i]] != ' ')
                {
                    ditchPos[i] = rnd.Next(MIN, MAX);
                }
                rooms[ditchPos[i]] = 'd';
            }
        }
        //Constructor
        public HighScoreManagement()
        {
            //High Score Management Constructor
            //Creates the top ten list including the default entries.
            Cave placeholder = new Cave("null");

            this.topTen    = new Player[limitTop];
            this.topTen[0] = new Player("Toma Itagaki", 0, placeholder);
            this.topTen[1] = new Player("James Joko", 0, placeholder);
            this.topTen[2] = new Player("Rishi Kavikondala", 0, placeholder);
            this.topTen[3] = new Player("Ryan Koshy", 0, placeholder);
            this.topTen[4] = new Player("Osbert Lee", 0, placeholder);
            this.topTen[5] = new Player("Adrienne Quan", 0, placeholder);
            for (int a = 6; a < limitTop; a++)
            {
                this.topTen[a] = new Player("placeholder", 0, placeholder);
            }
        }
Exemplo n.º 9
0
 public Game(Cave kave)
 {
     InitializeComponent();
     this.cave   = kave;
     this.scores = new HighScoreManagement();
     map         = new HuntTheWumpus.Map(2, 2, cave);
     game        = new GameControl();
     //using(MainMenu mainMenu = new MainMenu())
     //{
     //    if(mainMenu.ShowDialog() == DialogResult.OK)
     //    {
     //        this.playerName = mainMenu.getPlayerName;
     //    }
     //}
     player     = new Player(playerName, cave, map);
     sound      = new Sound();
     highscores = new HighScores();
     updateConnections();
     showRoom();
 }
Exemplo n.º 10
0
 /*initialize the Cave, give it structure*/
 public void initCave()
 {
     rooms = CreateRoomsList();
     int[,] connections = CreateConnectionArray();
     wumpusCave = new Cave(rooms, connections);
     wumpusCave.printCaveLayout();
 }
Exemplo n.º 11
0
 //This Constructor makes the default cases in the starting High Score list easy to assign.
 //Will be called by High Score Management
 public Player(String player, int score, Cave cave)
 {
     this.playerName = player;
     this.score      = score;
     this.cave       = cave;
 }