Ejemplo n.º 1
0
 public GameControl(Vector2 WindowSize)
 {
     // GState.Game loads the game
     // GState.Menu loads the menu
     GameState      = Gstate.Menu;
     MyWumpus       = new Wumpus(new Vector2(Room.RoomSize.Center.X - 200, Room.RoomSize.Center.Y - 200), "WumpusFiles\\Wumpus5_Small");
     MyTrivia       = new Trivia("Chemistry", new Vector2(), "Trivia\\backgroundTrivia");
     MyCave         = new Cave1("CaveFiles\\MapDataCave1.txt");
     MyPlayer       = new Player(new Vector2(WindowSize.X / 2, WindowSize.Y / 2), "Player\\Player5", 0, 10, 0, 0, 5f);
     MyMap          = new Map(MyCave.getTotalRooms());
     MySound        = new Sound();
     MyUI           = new GUI();
     GameDimensions = WindowSize;
 }
Ejemplo n.º 2
0
        public GameControl(Vector2 WindowSize)
        {
            // GState.Game loads the game
            // GState.Menu loads the menu
            GameState = Gstate.Menu;
            MyWumpus = new Wumpus(new Vector2(Room.thisSize.Center.X - 35, Room.thisSize.Center.Y - 35), "Wumpus2_Small");
            MyTrivia = new Trivia("Chemistry");
            MyCave = new Cave1("C:\\Users\\" + username + "\\Dropbox\\WumpusTest\\WumpusTest\\WumpusTestContent\\CaveFiles\\MapDataCave1.txt");
            MyPlayer = new Player(new Vector2(WindowSize.X / 2, WindowSize.Y / 2), "Player\\Player5", 0, 10, 0, 0, 3.5f);
            MyMap = new Map(MyCave.getTotalChambers());
            MySound = new Sound();

            MyUI = new GUI();
            GameDimensions = WindowSize;
        }
Ejemplo n.º 3
0
        public GameControl(Vector2 WindowSize)
        {
            // GState.Game loads the game
            // GState.Menu loads the menu
            GameState = Gstate.Menu;
            MyWumpus  = new Wumpus(new Vector2(Room.thisSize.Center.X - 35, Room.thisSize.Center.Y - 35), "Wumpus2_Small");
            MyTrivia  = new Trivia("Chemistry");
            MyCave    = new Cave1("C:\\Users\\" + username + "\\Dropbox\\WumpusTest\\WumpusTest\\WumpusTestContent\\CaveFiles\\MapDataCave1.txt");
            MyPlayer  = new Player(new Vector2(WindowSize.X / 2, WindowSize.Y / 2), "Player\\Player5", 0, 10, 0, 0, 3.5f);
            MyMap     = new Map(MyCave.getTotalChambers());
            MySound   = new Sound();

            MyUI           = new GUI();
            GameDimensions = WindowSize;
        }
Ejemplo n.º 4
0
        public GameControl(Vector2 WindowSize)
        {
            // GState.Game loads the game
            // GState.Menu loads the menu
            GameState = Gstate.Menu;
            MyPlayer = new Player(new Vector2(WindowSize.X/2, WindowSize.Y/2), "Player\\Player2", 0, 10, 0, 0, 3.5f);
            MyMap = new Map();
            MyWumpus = new Wumpus(Vector2.Zero, "Wumpus2_Small");
            MyTrivia = new Trivia("Chemistry");
            //UNIVERSAL TEST:
            MyCave = new Cave1("C:\\Users\\" + username + "\\Dropbox\\WumpusTest\\WumpusTest\\WumpusTestContent\\CaveFiles\\MapDataCave1.txt");
            MySound = new Sound();

            MyUI = new GUI();
            GameDimensions = WindowSize;
        }
Ejemplo n.º 5
0
        public GameControl(Vector2 WindowSize)
        {
            // GState.Game loads the game
            // GState.Menu loads the menu
            GameState = Gstate.Menu;
            MyPlayer  = new Player(new Vector2(WindowSize.X / 2, WindowSize.Y / 2), "Player\\Player2", 0, 10, 0, 0, 3.5f);
            MyMap     = new Map();
            MyWumpus  = new Wumpus(Vector2.Zero, "Wumpus2_Small");
            MyTrivia  = new Trivia("Chemistry");
            //UNIVERSAL TEST:
            MyCave  = new Cave1("C:\\Users\\" + username + "\\Dropbox\\WumpusTest\\WumpusTest\\WumpusTestContent\\CaveFiles\\MapDataCave1.txt");
            MySound = new Sound();

            MyUI           = new GUI();
            GameDimensions = WindowSize;
        }
Ejemplo n.º 6
0
        public Map(int cavenum)
        {
            //Sets random starting points for player and hazards
            //and ensures that player, wumpus, both bats, and bottomlesspits start in different locations
            //Creates an arraylist of numbers from 1 to 30
            //Sets a random index from 0 to the length of the arraylist and uses index to access value in arraylist
            //Removes value in Arraylist once set to a location
            num = new ArrayList();
            for (int i = 1; i <= 30; i++)
            {
                num.Add(i);
            }
            batsLocations          = new int[2];
            bottomlesspitLocations = new int[2];
            Random gen   = new Random();
            int    index = gen.Next(0, num.Count);

            playerLocation        = (int)num[index];
            initialPlayerLocation = playerLocation;
            num.RemoveAt(index);
            index          = gen.Next(0, num.Count);
            wumpusLocation = (int)num[index];
            num.RemoveAt(index);
            index            = gen.Next(0, num.Count);
            batsLocations[0] = (int)num[index];
            num.RemoveAt(index);
            index            = gen.Next(0, num.Count);
            batsLocations[1] = (int)num[index];
            num.RemoveAt(index);
            index = gen.Next(0, num.Count);
            bottomlesspitLocations[0] = (int)num[index];
            num.RemoveAt(index);
            index = gen.Next(0, num.Count);
            bottomlesspitLocations[1] = (int)num[index];
            num.RemoveAt(index);
            cave         = new Cave(cavenum);
            wumpus       = new Wumpus();
            arrayOfRooms = cave.getRoomConnections();
            player       = new Player();
        }
Ejemplo n.º 7
0
        public bool isWumpusInRoom(int user_input)
        {
            //This method checks if an arrow
            //that the user shoots hits the
            //wumpus. If it does the method
            //returns true, or the method
            //returns false
            bool wumpus = false;

            //Sets the return variable to valse
            int[] surroundingRooms = new int[6];
            //Creates an array to get surrounding rooms to the player location
            for (int i = 0; i < surroundingRooms.Length; i++)
            {
                surroundingRooms[i] = Math.Abs(arrayOfRooms[playerLocation - 1, i]);
                //transfers data from connections 2D Array to surroundingRooms
            }
            if (wumpusLocation == surroundingRooms[(user_input - 1) % 6])
            {
                wumpus = true;
            }
            return(wumpus);
        }