private int score; //the total score for the player #endregion Fields #region Constructors //Construction public Player(PlayerIndex index) { connected = true; this.index = index; score = 0; input = new InputHandler(index); bullets = new List<Bullet>(); InitLives(); }
private static Properties instance; //The ONLY instance of PROPERTIES #endregion Fields #region Constructors private Properties() { players.Add(new Player(PlayerIndex.One)); //players.Add(new Player(PlayerIndex.Two)); //For Xbox if (GamePad.GetState(PlayerIndex.One).IsConnected) players.Add(new Player(PlayerIndex.One)); if (GamePad.GetState(PlayerIndex.Two).IsConnected) players.Add(new Player(PlayerIndex.Two)); if (GamePad.GetState(PlayerIndex.Three).IsConnected) players.Add(new Player(PlayerIndex.Three)); if (GamePad.GetState(PlayerIndex.Four).IsConnected) players.Add(new Player(PlayerIndex.Four)); PlayerIndex[] indexes = new PlayerIndex[players.Count]; for (int i = 0; i < players.Count; i++) indexes[i] = players[i].ControllerIndex; allInput = new InputHandler(indexes); }