public int popLevel() { sp--; prevState = cur; cur = states[levelStack[sp]]; curLevNum = levelStack[sp]; prevState.ExitLevel(); RC_GameStateParent.prevKeyState = Keyboard.GetState(); RC_GameStateParent.keyState = Keyboard.GetState(); // fix legacy keystate issues RC_GameStateParent.previousMouseState = Mouse.GetState(); RC_GameStateParent.currentMouseState = Mouse.GetState(); return(curLevNum); }
public void setLevel(int levNum) { prevState = cur; states[levNum].EnterLevel(curLevNum); cur = states[levNum]; prevStatePlayLevel = cur; // to call draw prevState.ExitLevel(); curLevNum = levNum; RC_GameStateParent.prevKeyState = Keyboard.GetState(); RC_GameStateParent.keyState = Keyboard.GetState(); // fix legacy keystate issues RC_GameStateParent.previousMouseState = Mouse.GetState(); RC_GameStateParent.currentMouseState = Mouse.GetState(); }