예제 #1
0
            }   // end of Shared c'tor

            private void ChangeExpression(Boku.Base.GameTimer timer)
            {
                int newFace = BokuGame.bokuGame.rnd.Next(6);

                switch (newFace)
                {
                case 0:
                    boku.DisplayEmotionalState(Face.FaceState.Crazy, (float)(1.0 + BokuGame.bokuGame.rnd.NextDouble()));
                    break;

                case 1:
                    boku.DisplayEmotionalState(Face.FaceState.Happy, (float)(1.0 + BokuGame.bokuGame.rnd.NextDouble()));
                    break;

                case 2:
                    boku.DisplayEmotionalState(Face.FaceState.Mad, (float)(1.0 + BokuGame.bokuGame.rnd.NextDouble()));
                    break;

                case 3:
                    boku.DisplayEmotionalState(Face.FaceState.Remember, (float)(1.0 + BokuGame.bokuGame.rnd.NextDouble()));
                    break;

                case 4:
                    boku.DisplayEmotionalState(Face.FaceState.Sad, (float)(1.0 + BokuGame.bokuGame.rnd.NextDouble()));
                    break;

                case 5:
                    boku.DisplayEmotionalState(Face.FaceState.Squint, (float)(1.0 + BokuGame.bokuGame.rnd.NextDouble()));
                    break;
                }

                timer.Reset(4.0 + 4.0 * BokuGame.bokuGame.rnd.NextDouble());
            }   // end of ChangeExpression()
예제 #2
0
 protected void RepeatPress(Boku.Base.GameTimer timer)
 {
     // NOTE: do not call Start on this timer, it is being used in a caller update model
     timerAutoRepeat.Reset(timeAutoRepeat);
     FireRepeatEvent(digitalPosition);
     if (digitalPosition != DigitalPosition.centered && this.PositionRepeatPress != null)
     {
         this.PositionRepeatPress(this, new StickEventArgs(this.position));
     }
 }
예제 #3
0
 protected void OnRepeatPress(Boku.Base.GameTimer timer)
 {
     // NOTE: do not call Start on this timer, it is being used in a caller update model
     timerAutoRepeat.Reset(timeAutoRepeat);
     if (RepeatPress != null)
     {
         RepeatPress(this, new System.EventArgs());
     }
     this.state = ButtonCommandState.Repeat;
 }
예제 #4
0
 protected void OnRepeatPress(Boku.Base.GameTimer timer)
 {
     // NOTE: do not call Start on this timer, it is being used in a caller update model
     timerAutoRepeat.Reset(timeAutoRepeat);
     if (RepeatPress != null || CharInput != null)
     {
         for (int indexKey = 0; indexKey < this.pressedKeys.Length; indexKey++)
         {
             Keys key = this.pressedKeys[indexKey];
             if (!IsModifierKey(key))
             {
                 if (RepeatPress != null)
                 {
                     RepeatPress(this, new KeyboardKeyEventArgs(key));
                 }
                 if (CharInput != null)
                 {
                     OnChar(key);
                 }
             }
         }
     }
     this.state = KeyCommandState.Repeat;
 }
예제 #5
0
 protected void OnRepeatPress(Boku.Base.GameTimer timer)
 {
     // NOTE: do not call Start on this timer, it is being used in a caller update model
     timerAutoRepeat.Reset(timeAutoRepeat);
     FireRepeatEvent(digitalPosition);
 }