private void playerWin(Character player) { player.MyWins += 1; for (int i = 0; i < roundIndicators.Length; i++) { if (i < (roundIndicators.Length / 2)) { if (i < Player1.MyWins) roundIndicators[i].ClipTangle = new Rectangle(40, 0, 40, 40); } else { if ((i - (roundIndicators.Length / 2)) < Player2.MyWins) roundIndicators[i].ClipTangle = new Rectangle(40, 0, 40, 40); } roundIndicators[i].refreshClipping(); } if (player.MyWins == (constants.NUM_ROUNDS / 2)) { wintext = player.MySprite.charName.ToUpper() + " IS CHAMPION. HOORAY!"; currentState = constants.LEVELSTATE.GAMEWIN; } else { wintext = player.MySprite.charName.ToUpper() + " WINS"; currentState = constants.LEVELSTATE.ROUNDWIN; } winTextPos.X = (constants.SCREEN_WIDTH / 2) - (mainFont.MeasureString(wintext).X / 2); winTextPos.Y = (constants.SCREEN_HEIGHT / 2) - (mainFont.MeasureString(wintext).Y / 2); }
/// <summary> /// This should only be called after everything has been constructed in the current level. /// </summary> public void Reset() { Player1.Reset(); Player2.Reset(); Player1.MySprite.GlobPos = new Vector2(0, (int)(constants.GROUND_HEIGHT - (constants.SPRITE_SIZE * constants.SPRITE_SCALE))); Player2.MySprite.GlobPos = new Vector2(constants.SCREEN_WIDTH - (int)(constants.SPRITE_WIDTH * constants.SPRITE_SCALE), (int)(constants.GROUND_HEIGHT - (constants.SPRITE_SIZE * constants.SPRITE_SCALE))); currentState = constants.LEVELSTATE.PLAYING; }