public void Activate(Player players) { player = players; opposingPlayer = players; Effect(); }
public void Trigger(Player target, int duration) { state = State.ACTIVE; player = target; timer = duration; Init(); }
public void Destroy() { // Nullify variables player = null; opposingPlayer = null; active = false; visible = false; description = ""; chance = 0; }
public override void Init() { numPlayers = (teamSize * 2); player = new Player[numPlayers]; // Instantiate players if (teamSize == Global.MIN_TEAM_SIZE) { player[0] = new Player(PlayerIndex.One, Global.RED_TEAM, (int)Player.Orientation.RIGHT, new Vector2(300, 380)); player[1] = new Player(PlayerIndex.Two, Global.BLUE_TEAM, (int)Player.Orientation.LEFT, new Vector2(1040, 380)); } else if (teamSize == Global.MAX_TEAM_SIZE) { player[0] = new Player(PlayerIndex.One, Global.RED_TEAM, (int)Player.Orientation.RIGHT, new Vector2(300, 240)); player[1] = new Player(PlayerIndex.Two, Global.RED_TEAM, (int)Player.Orientation.RIGHT, new Vector2(300, 500)); player[2] = new Player(PlayerIndex.Three, Global.BLUE_TEAM, (int)Player.Orientation.LEFT, new Vector2(1040, 240)); player[3] = new Player(PlayerIndex.Four, Global.BLUE_TEAM, (int)Player.Orientation.LEFT, new Vector2(1040, 500)); } else { System.Console.WriteLine("ERROR: numPlayers is not even (must be set to 2 or 4 in order to play)"); } for (int i = 0; i < numPlayers; i++) { collisionArray.Add(player[i]); } redVictorySprite.position.X = blueVictorySprite.position.X = (Program.SCREEN_WIDTH / 2) - 250; redVictorySprite.position.Y = blueVictorySprite.position.Y = (Program.SCREEN_HEIGHT / 2) - 350; wall.position = new Vector2(((Program.SCREEN_WIDTH / 2) - (wall.width / 2)), 120); // Initialise game components redCourt.Init(); blueCourt.Init(); hud.Init(); // Update collision array collisionArray.Add(wall); base.Init(); }