public void Update(GameTime gameTime) { switch (state) { case SurvivalState.Start: if (InputUtils.gesture == PXCMGesture.Gesture.Label.LABEL_POSE_THUMB_UP) { state = SurvivalState.Count; clCountDown.start(3); } break; case SurvivalState.Count: clCountDown.checkTime(gameTime); if (clCountDown.isFinished) { clTimer.start(START_TIME); state = SurvivalState.Game; } break; case SurvivalState.Game: clTimer.checkTime(gameTime); UpdateGame(gameTime); break; case SurvivalState.Finish: break; default: break; } }
public void UpdateGame(GameTime gameTime) { if (clTimer.isRunning) { if (InputUtils.gesture == currGesture) { GetNextGesture(); bAddSec = true; nScore++; clTimer.SecondsLeft++; } } else { state = SurvivalState.Finish; } }
public void Init() { clCountDown = new ClockTimer(); clTimer = new ClockTimer(); state = SurvivalState.Start; nScore = 0; bAddSec = false; gestList = new List <PXCMGesture.Gesture.Label>() { PXCMGesture.Gesture.Label.LABEL_NAV_SWIPE_LEFT, PXCMGesture.Gesture.Label.LABEL_NAV_SWIPE_RIGHT, PXCMGesture.Gesture.Label.LABEL_POSE_THUMB_UP, PXCMGesture.Gesture.Label.LABEL_POSE_THUMB_DOWN, PXCMGesture.Gesture.Label.LABEL_POSE_PEACE }; vGestLoc = new Vector2((MyGraphics.screenRect.Width / 2) - (MyGraphics.GetTexture("g_up").Width / 2), MyGraphics.screenRect.Height / 5); vTime = new Vector2((MyGraphics.screenRect.Right - 150), 0); }