public void StartSession() { int level = (int)difficulty; ButtonFade = 350 - level * 50; CreateSession(difficulty, 2 * ButtonFade + (2 - level) * 50); RandomizeGrid(activeGrid); var pair = RandomPositionPair(); menuSlider.SlideOut(pair.Out); gridSlider.SlideIn(pair.In); }
public void StopSession(bool gameOver = false) { var pair = RandomPositionPair(); gridSlider.SlideOut(pair.Out); if (gameOver) { gameOverSlider.SlideIn(pair.In); } else { menuSlider.SlideIn(pair.In); } }
private void InitSlider() { menuSlider = GetItem <SlidingPane>("menuSlider"); gridSlider = GetItem <SlidingPane>("gridSlider"); gameOverSlider = GetItem <SlidingPane>("gameOverSlider"); gridSlider.SlidedIn += (s, a) => Session.EvaluateNextTiles(); gameOverSlider.SlidedIn += (s, a) => { var pair = RandomPositionPair(); gameOverSlider.SlideOut(pair.Out); menuSlider.SlideIn(pair.In); }; }
protected override void Init() { var mniYes = GetItem <MenuItem>("itmYes"); var mniNo = GetItem <MenuItem>("itmNo"); slider = GetItem <SlidingPane>("pauseSlider"); fader = GetItem <FadingPane>("pauseFader"); slider.SlideIn(GenericPosition.Bottom); fader.FadeIn(); mniYes.IsDisabled = true; // takes away focus mniYes.IsDisabled = false; mniNo.IsDisabled = true; // takes away focus mniNo.IsDisabled = false; var colYes = mniYes.TextItem.Color; var colNo = mniNo.TextItem.Color; mniYes.FocusGain += (s, a) => mniYes.TextItem.Color = Color.Yellow; mniNo.FocusGain += (s, a) => mniNo.TextItem.Color = Color.Yellow; mniYes.FocusLoss += (s, a) => mniYes.TextItem.Color = colYes; mniNo.FocusLoss += (s, a) => mniNo.TextItem.Color = colNo; mniNo.Action += (s, a) => { slider.SlideOut(GenericPosition.Top); fader.FadeOut(); }; mniYes.Action += (s, a) => { parent.StopSession(); slider.SlideOut(GenericPosition.Top); fader.FadeOut(); }; slider.SlidedOut += (s, a) => { parent.InputDisabled = false; Close(); }; }