public void update(double dt) { if (playersReady[0] && playersReady[1] && playersReady[2] && playersReady[3] && playersReady[4] && playersReady[5] && playersReady[6] && playersReady[7]) { if (playReadySF) { ready.Play(); playReadySF = false; } readyWait -= dt; if (readyWait < 0) { GameStateFighting gsf = new GameStateFighting(Content, Game, playerColors, net); net.setGSF(gsf); Game.doStateTransition(gsf); } } for (int x = 0; x < 8; x++) { if (playersReady[x]) { playerSlides[x] += (float)dt * 4; } } }
void prepareMatch() { currentMatch++; if (currentMatch >= matchList.Length) { net.sendMessage("s"); Game.doStateTransition(new GameStateResults(Content, Game, playerColors, scores)); return; } winnerTime = 751; goTimer = 250; sdTimer = 0; net.sendMessage("s"); camera.resetZoom(); extraFields = new List <Sprite>(); extraFieldTimes = new List <float>(); extraFieldColors = new List <Color>(); playedGSE = false; sentNet = false; invertControls = false; shakeAmnt = Vector2.Zero; fieldMultiplier = 1f; cfAmount = 0f; camera.setPosition(new Vector2(350, -1 * (Game1.SCREEN_WIDTH / 5))); camera.resetRotation(); platform.position = Vector2.Zero; playerOne.stickVelocity = Vector2.Zero; playerOne.gravityVelocity = Vector2.Zero; playerOne.lastStickPosition = Vector2.Zero; playerOneNumber = (int)matchList[currentMatch].X; playerOne.fireTime = 0; playerOne.position = new Vector2(25, -100); playerTwo.stickVelocity = Vector2.Zero; playerTwo.gravityVelocity = Vector2.Zero; playerTwo.lastStickPosition = Vector2.Zero; playerTwoNumber = (int)matchList[currentMatch].Y; playerTwo.fireTime = 0; playerTwo.position = new Vector2(633, -100); playerTwo.facingLeft = true; }