public void writeNotificationWindow(SpriteBatch sprite, string header, string notifiation, StageScreenStates state = StageScreenStates.PAUSED) { switch( state ){ case StageScreenStates.PAUSED: notifWindowColor = Color.Tomato; break; case StageScreenStates.RESUMING: notifWindowColor = Color.GreenYellow; break; } sprite.Draw(textures[StageBox.BASIC_BOX], basicBoxPos, null, notifWindowColor * 0.75f, 0f, Vector2.Zero, basicBoxScale, SpriteEffects.None, 0f); sprite.DrawString(notificationHeadingFont, header, basicBoxPos + Vector2.One * 20, Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); sprite.DrawString(notificationMsgFont, "\n\n" +notifiation, basicBoxPos + Vector2.One * 20, Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); }
public void Draw(SpriteBatch sprite, StageScreenStates currentState) { }
private void updateGameSequentialSolo() { switch (gameMode) { case GameSequentialSolo.SOLO_BUBBLES: bubbleCtr--; if (soloBubblesToPop > 0) { if (bubbleCtr <= 0) { createRandomBubble(); bubbleCtr = bubbleInterval; } else if (bubbleCtr > GameConfig.MIN_GAP_BETWEEN_BUBBLES && bubblesOnScreen.Count == 0) { bubbleCtr = GameConfig.MIN_GAP_BETWEEN_BUBBLES; } } else { if (bubblesOnScreen.Count <= 0) { gameMode = GameSequentialSolo.SET_BUBBLES; } } break; case GameSequentialSolo.DRAG_BUBBLE: dragBubbleCtr--; if (dragBubblesToPop > 0) { if (dragBubbleCtr <= 0) { createDragBubble(); dragBubbleCtr = dragBubbleInterval; } else if (dragBubbleCtr > GameConfig.MIN_GAP_BETWEEN_BUBBLES && dragBubblesOnScreen.Count == 0) { dragBubbleCtr = GameConfig.MIN_GAP_BETWEEN_BUBBLES; } } else { if (dragBubblesOnScreen.Count <= 0) { currentState = StageScreenStates.ENDING; } } break; case GameSequentialSolo.SET_BUBBLES: bubbleSetCtr--; if (setBubblesToPop > 0) { if (bubbleSetCtr <= 0) { createBubbleSet(); bubbleSetCtr = bubbleSetInterval; } else if (bubbleSetCtr > GameConfig.MIN_GAP_BETWEEN_BUBBLES && bubbleSetsOnScreen.Count == 0) { bubbleSetCtr = GameConfig.MIN_GAP_BETWEEN_BUBBLES; } } else { if (bubbleSetsOnScreen.Count <= 0) { gameMode = GameSequentialSolo.DRAG_BUBBLE; } } break; } }
private void updateGame() { updateInterval(); if (kinector.isTrackingSkeleton() || usingMouseAsInput) { switch( currentGame ){ case TAPGame.SEQUENTIAL_SOLO: switch (gameMode) { case GameSequentialSolo.SOLO_BUBBLES: updateSoloBubbles(); break; case GameSequentialSolo.DRAG_BUBBLE: updateDragBubbles(); break; case GameSequentialSolo.SET_BUBBLES: updateBubbleSets(); break; } break; case TAPGame.SEQUENTIAL_MIXED: updateSoloBubbles(); updateDragBubbles(); updateBubbleSets(); break; } } else { currentState = StageScreenStates.PAUSED; } }
/* =================================================================== * UPDATE METHODS * =================================================================== */ public override void Update() { base.UpdateComponents(); switch(currentState){ case StageScreenStates.PREPARING: //see in Draw function the calling of the function prepareStageUI if (currentPreparationState == StagePreparationStates.FINISHED) { currentState = StageScreenStates.RUNNING; } break; case StageScreenStates.RUNNING: updateGame(); effectHandler.Update(); break; case StageScreenStates.PAUSED: if (kinector.isTrackingSkeleton()) { resumeCtr = GameConfig.RESUME_COUNT; currentState = StageScreenStates.RESUMING; } break; case StageScreenStates.RESUMING: resumeCtr--; if (resumeCtr <= 0) { currentState = StageScreenStates.RUNNING; } break; case StageScreenStates.ENDING: //do something break; } }
public void Init() { bubblesOnScreen = new List<Bubble>(); bubbleSetsOnScreen = new List<BubbleSet>(); dragBubblesOnScreen = new List<DragBubble>(); //interval between most recently added bubble to the next bubble this.bubbleSetInterval = GameConfig.BUBBLE_SET_INTERVAL; this.bubbleInterval = GameConfig.SOLO_BUBBLE_INTERVAL; this.dragBubbleInterval = GameConfig.DRAG_BUBBLE_INTERVAL; this.gameMode = GameSequentialSolo.SOLO_BUBBLES; this.soloBubblesToPop = GameConfig.SOLO_BUBBLES_TO_POP; this.dragBubblesToPop = GameConfig.DRAG_BUBBLES_TO_POP; this.setBubblesToPop = GameConfig.BUBBLE_SETS_TO_POP; bubbleCtr = GameConfig.SOLO_BUBBLE_INTERVAL; bubbleSetCtr = GameConfig.BUBBLE_SET_INTERVAL; dragBubbleCtr = GameConfig.DRAG_BUBBLE_INTERVAL; this.effectHandler = new EffectHandler(); this.usingMouseAsInput = true; this.currentGame = TAPGame.SEQUENTIAL_MIXED; myUI = new MyUI(); this.currentState = StageScreenStates.PREPARING; }