public Player(GameStateManager gameStateManager, Player.Type type, bool isHuman, KeyboardManager.playerIndex pi) { this.isHuman = isHuman; this.coins = 0; this.stars = 0; this.totalMiniGameWins = 0; this.totalMiniGameLosses = 0; this.totalRedSpaceLands = 0; this.totalBlueSpaceLands = 0; this.totalChanceSpaceLands = 0; this.totalSpecialSpaceLands = 0; this.totalCoinsGained = 0; this.totalCoinsLost = 0; this.playerControlsIndex = pi; this.uiColor = Color.White; switch (type) { case Player.Type.FRANK: this.meeple = new E_Meeple(gameStateManager, new Vector2(0, 0), type); this.closeupPicture = gameStateManager.game.spr_FrankCloseup; this.chancePicture = gameStateManager.game.spr_chanceFrank; this.characterColor = Color.SaddleBrown; this.type = type; break; case Player.Type.LOUIE: this.meeple = new E_Meeple(gameStateManager, new Vector2(0, 0), type); this.closeupPicture = gameStateManager.game.spr_LouieCloseup; this.chancePicture = gameStateManager.game.spr_chanceLouie; this.characterColor = Color.Lime; this.type = type; break; case Player.Type.MANFORD: this.meeple = new E_Meeple(gameStateManager, new Vector2(0, 0), type); this.closeupPicture = gameStateManager.game.spr_ManfordCloseup; this.chancePicture = gameStateManager.game.spr_chanceManford; this.characterColor = Color.Red; this.type = type; break; case Player.Type.SUE: this.meeple = new E_Meeple(gameStateManager, new Vector2(0, 0), type); this.closeupPicture = gameStateManager.game.spr_SueCloseup; this.chancePicture = gameStateManager.game.spr_chanceSue; this.characterColor = Color.Magenta; this.type = type; break; case Player.Type.VELMA: this.meeple = new E_Meeple(gameStateManager, new Vector2(0, 0), type); this.closeupPicture = gameStateManager.game.spr_VelmaCloseup; this.chancePicture = gameStateManager.game.spr_chanceVelma; this.characterColor = Color.Yellow; this.type = type; break; case Player.Type.WILBER: this.meeple = new E_Meeple(gameStateManager, new Vector2(0, 0), type); this.closeupPicture = gameStateManager.game.spr_WilberCloseup; this.chancePicture = gameStateManager.game.spr_chanceWilber; this.characterColor = Color.DarkOrchid; this.type = type; break; } // end switch } // end constructor
// Collection of Spaces: //public List<E_Space> spaces; // Constructor: public B_PirateBay(GameStateManager creator, float xPos, float yPos) : base(creator, xPos, yPos) { // --------------------------- Create Spaces: ---------------------------------- // initialize list of spaces: spaces = new List <E_Space>(); E_Space curSpace; E_Space prevSpace; // STARTING WITH BOTTOM RIGHT // <<---- MOVING LEFT NOW: ----->> // Bottom right space: curSpace = new E_Space(this, GetTilePosCenter(21, 16), Entity.typeSpace.blue); curSpace.setOverlapPositions(E_Space.direction.left); spaces.Add(curSpace); this.startingSpace = curSpace; // STARTING SPACE prevSpace = curSpace; // 20, 16 // Blue curSpace = new E_Space(this, GetTilePosCenter(20, 16), Entity.typeSpace.blue); curSpace.setOverlapPositions(E_Space.direction.left); spaces.Add(curSpace); // add to overall list curSpace.assignSpaces(prevSpace); prevSpace = curSpace; // 19, 16 // Blue curSpace = new E_Space(this, GetTilePosCenter(19, 16), Entity.typeSpace.blue); curSpace.setOverlapPositions(E_Space.direction.left); spaces.Add(curSpace); // add to overall list curSpace.assignSpaces(prevSpace); prevSpace = curSpace; // 17, 16 // Red curSpace = new E_Space(this, GetTilePosCenter(17, 16), Entity.typeSpace.red); curSpace.setOverlapPositions(E_Space.direction.left); spaces.Add(curSpace); // add to overall list curSpace.assignSpaces(prevSpace); prevSpace = curSpace; // 16, 15 // Blue curSpace = new E_Space(this, GetTilePosCenter(16, 15), Entity.typeSpace.blue); curSpace.setOverlapPositions(E_Space.direction.left); spaces.Add(curSpace); // add to overall list curSpace.assignSpaces(prevSpace); prevSpace = curSpace; // 15, 15 // Blue curSpace = new E_Space(this, GetTilePosCenter(15, 15), Entity.typeSpace.blue); curSpace.setOverlapPositions(E_Space.direction.left); spaces.Add(curSpace); // add to overall list curSpace.assignSpaces(prevSpace); prevSpace = curSpace; // 14, 15 // Red curSpace = new E_Space(this, GetTilePosCenter(14, 15), Entity.typeSpace.red); curSpace.setOverlapPositions(E_Space.direction.left); spaces.Add(curSpace); // add to overall list curSpace.assignSpaces(prevSpace); prevSpace = curSpace; // 12, 15 // Blue curSpace = new E_Space(this, GetTilePosCenter(12, 15), Entity.typeSpace.blue); curSpace.setOverlapPositions(E_Space.direction.left); spaces.Add(curSpace); // add to overall list curSpace.assignSpaces(prevSpace); prevSpace = curSpace; // 12, 16 // Blue curSpace = new E_Space(this, GetTilePosCenter(12, 16), Entity.typeSpace.blue); curSpace.setOverlapPositions(E_Space.direction.left); spaces.Add(curSpace); // add to overall list curSpace.assignSpaces(prevSpace); prevSpace = curSpace; // 10, 16 curSpace = new E_Space(this, GetTilePosCenter(10, 16), Entity.typeSpace.red); curSpace.setOverlapPositions(E_Space.direction.left); spaces.Add(curSpace); // add to overall list curSpace.assignSpaces(prevSpace); prevSpace = curSpace; // 7, 16 curSpace = new E_Space(this, GetTilePosCenter(7, 16), Entity.typeSpace.blue); curSpace.setOverlapPositions(E_Space.direction.left); spaces.Add(curSpace); // add to overall list curSpace.assignSpaces(prevSpace); prevSpace = curSpace; // 6, 16 CHANCE TIME curSpace = new E_Space(this, GetTilePosCenter(6, 16), Entity.typeSpace.chance); curSpace.setOverlapPositions(E_Space.direction.left); spaces.Add(curSpace); // add to overall list curSpace.assignSpaces(prevSpace); prevSpace = curSpace; // <<---- MOVING UP NOW: ----->> // 6, 15 curSpace = new E_Space(this, GetTilePosCenter(6, 15), Entity.typeSpace.blue); curSpace.setOverlapPositions(E_Space.direction.up); spaces.Add(curSpace); // add to overall list curSpace.assignSpaces(prevSpace); prevSpace = curSpace; // 6, 13 curSpace = new E_Space(this, GetTilePosCenter(6, 13), Entity.typeSpace.red); curSpace.setOverlapPositions(E_Space.direction.up); spaces.Add(curSpace); // add to overall list curSpace.assignSpaces(prevSpace); prevSpace = curSpace; // 6, 10 curSpace = new E_Space(this, GetTilePosCenter(6, 10), Entity.typeSpace.blue); curSpace.setOverlapPositions(E_Space.direction.up); spaces.Add(curSpace); // add to overall list curSpace.assignSpaces(prevSpace); prevSpace = curSpace; // 6, 9 curSpace = new E_Space(this, GetTilePosCenter(6, 9), Entity.typeSpace.blue); curSpace.setOverlapPositions(E_Space.direction.up); spaces.Add(curSpace); // add to overall list curSpace.assignSpaces(prevSpace); prevSpace = curSpace; // 4, 9 curSpace = new E_Space(this, GetTilePosCenter(4, 9), Entity.typeSpace.blue); curSpace.setOverlapPositions(E_Space.direction.up); spaces.Add(curSpace); // add to overall list curSpace.assignSpaces(prevSpace); prevSpace = curSpace; // 3, 9 curSpace = new E_Space(this, GetTilePosCenter(3, 9), Entity.typeSpace.chance); curSpace.setOverlapPositions(E_Space.direction.up); spaces.Add(curSpace); // add to overall list curSpace.assignSpaces(prevSpace); prevSpace = curSpace; // 3, 8 curSpace = new E_Space(this, GetTilePosCenter(3, 8), Entity.typeSpace.blue); curSpace.setOverlapPositions(E_Space.direction.up); spaces.Add(curSpace); // add to overall list curSpace.assignSpaces(prevSpace); prevSpace = curSpace; // 3, 7 curSpace = new E_Space(this, GetTilePosCenter(3, 7), Entity.typeSpace.blue); curSpace.setOverlapPositions(E_Space.direction.up); spaces.Add(curSpace); // add to overall list curSpace.assignSpaces(prevSpace); prevSpace = curSpace; // 3, 3 curSpace = new E_Space(this, GetTilePosCenter(3, 3), Entity.typeSpace.red); curSpace.setOverlapPositions(E_Space.direction.up); spaces.Add(curSpace); // add to overall list curSpace.assignSpaces(prevSpace); prevSpace = curSpace; // 3, 2 curSpace = new E_Space(this, GetTilePosCenter(3, 2), Entity.typeSpace.blue); curSpace.setOverlapPositions(E_Space.direction.up); spaces.Add(curSpace); // add to overall list curSpace.assignSpaces(prevSpace); prevSpace = curSpace; // <<---- MOVING RIGHT NOW: ----->> // 4, 1 curSpace = new E_Space(this, GetTilePosCenter(4, 1), Entity.typeSpace.blue); curSpace.setOverlapPositions(E_Space.direction.right); spaces.Add(curSpace); // add to overall list curSpace.assignSpaces(prevSpace); prevSpace = curSpace; // 5, 1 curSpace = new E_Space(this, GetTilePosCenter(5, 1), Entity.typeSpace.blue); curSpace.setOverlapPositions(E_Space.direction.right); spaces.Add(curSpace); // add to overall list curSpace.assignSpaces(prevSpace); prevSpace = curSpace; // 7, 1 curSpace = new E_Space(this, GetTilePosCenter(7, 1), Entity.typeSpace.blue); curSpace.setOverlapPositions(E_Space.direction.right); spaces.Add(curSpace); // add to overall list curSpace.assignSpaces(prevSpace); prevSpace = curSpace; // 8, 2 curSpace = new E_Space(this, GetTilePosCenter(8, 2), Entity.typeSpace.red); curSpace.setOverlapPositions(E_Space.direction.right); spaces.Add(curSpace); // add to overall list curSpace.assignSpaces(prevSpace); prevSpace = curSpace; // 9, 2 curSpace = new E_Space(this, GetTilePosCenter(9, 2), Entity.typeSpace.red); curSpace.setOverlapPositions(E_Space.direction.right); spaces.Add(curSpace); // add to overall list curSpace.assignSpaces(prevSpace); prevSpace = curSpace; // 10, 3 curSpace = new E_Space(this, GetTilePosCenter(10, 3), Entity.typeSpace.red); curSpace.setOverlapPositions(E_Space.direction.right); spaces.Add(curSpace); // add to overall list curSpace.assignSpaces(prevSpace); prevSpace = curSpace; // 12, 3 curSpace = new E_Space(this, GetTilePosCenter(12, 3), Entity.typeSpace.blue); curSpace.setOverlapPositions(E_Space.direction.right); spaces.Add(curSpace); // add to overall list curSpace.assignSpaces(prevSpace); prevSpace = curSpace; // 13, 3 curSpace = new E_Space(this, GetTilePosCenter(13, 3), Entity.typeSpace.blue); curSpace.setOverlapPositions(E_Space.direction.right); spaces.Add(curSpace); // add to overall list curSpace.assignSpaces(prevSpace); prevSpace = curSpace; // 14, 3 curSpace = new E_Space(this, GetTilePosCenter(14, 3), Entity.typeSpace.chance); curSpace.setOverlapPositions(E_Space.direction.right); spaces.Add(curSpace); // add to overall list curSpace.assignSpaces(prevSpace); prevSpace = curSpace; // 16, 3 curSpace = new E_Space(this, GetTilePosCenter(16, 3), Entity.typeSpace.red); curSpace.setOverlapPositions(E_Space.direction.right); spaces.Add(curSpace); // add to overall list curSpace.assignSpaces(prevSpace); prevSpace = curSpace; // 17, 4 curSpace = new E_Space(this, GetTilePosCenter(17, 4), Entity.typeSpace.blue); curSpace.setOverlapPositions(E_Space.direction.right); spaces.Add(curSpace); // add to overall list curSpace.assignSpaces(prevSpace); prevSpace = curSpace; // 18, 4 curSpace = new E_Space(this, GetTilePosCenter(18, 4), Entity.typeSpace.blue); curSpace.setOverlapPositions(E_Space.direction.right); spaces.Add(curSpace); // add to overall list curSpace.assignSpaces(prevSpace); prevSpace = curSpace; // <<---- MOVING DOWN NOW: ----->> // 19, 5 curSpace = new E_Space(this, GetTilePosCenter(19, 5), Entity.typeSpace.blue); curSpace.setOverlapPositions(E_Space.direction.down); spaces.Add(curSpace); // add to overall list curSpace.assignSpaces(prevSpace); prevSpace = curSpace; // 19, 7 curSpace = new E_Space(this, GetTilePosCenter(19, 7), Entity.typeSpace.blue); curSpace.setOverlapPositions(E_Space.direction.down); spaces.Add(curSpace); // add to overall list curSpace.assignSpaces(prevSpace); prevSpace = curSpace; // 19, 8 curSpace = new E_Space(this, GetTilePosCenter(19, 8), Entity.typeSpace.red); curSpace.setOverlapPositions(E_Space.direction.down); spaces.Add(curSpace); // add to overall list curSpace.assignSpaces(prevSpace); prevSpace = curSpace; // 19, 10 curSpace = new E_Space(this, GetTilePosCenter(19, 10), Entity.typeSpace.chance); curSpace.setOverlapPositions(E_Space.direction.down); spaces.Add(curSpace); // add to overall list curSpace.assignSpaces(prevSpace); prevSpace = curSpace; // 19, 11 curSpace = new E_Space(this, GetTilePosCenter(19, 11), Entity.typeSpace.blue); curSpace.setOverlapPositions(E_Space.direction.down); spaces.Add(curSpace); // add to overall list curSpace.assignSpaces(prevSpace); prevSpace = curSpace; // 19, 13 curSpace = new E_Space(this, GetTilePosCenter(19, 13), Entity.typeSpace.red); curSpace.setOverlapPositions(E_Space.direction.down); spaces.Add(curSpace); // add to overall list curSpace.assignSpaces(prevSpace); prevSpace = curSpace; // 21, 13 curSpace = new E_Space(this, GetTilePosCenter(21, 13), Entity.typeSpace.blue); curSpace.setOverlapPositions(E_Space.direction.down); spaces.Add(curSpace); // add to overall list curSpace.assignSpaces(prevSpace); prevSpace = curSpace; // 22, 13 curSpace = new E_Space(this, GetTilePosCenter(22, 13), Entity.typeSpace.red); curSpace.setOverlapPositions(E_Space.direction.down); spaces.Add(curSpace); // add to overall list curSpace.assignSpaces(prevSpace); prevSpace = curSpace; // 22, 15 FINAL PIECE curSpace = new E_Space(this, GetTilePosCenter(22, 15), Entity.typeSpace.chance); curSpace.setOverlapPositions(E_Space.direction.down); spaces.Add(curSpace); // add to overall list curSpace.assignSpaces(prevSpace); this.finalSpace = curSpace; // FINAL SPACE // Finally, link up last space and first space: this.startingSpace.assignSpaces(this.finalSpace); // Assign the star space to a random space MGP_Tools.Assign_Star(this); // Assign starting space to all players foreach (Player p in this.gameOptions.players) { p.currSpace = this.startingSpace; p.meeple.setPos(p.currSpace.getMeepleLocation()); // Occupy that space so another meeple doesn't run him/her over: p.currSpace.occupySpace(p); } } // end constructor