コード例 #1
0
        private void player_Spin(object sender, DreidelEventArgs e)
        {
            Random randomSpeed;

            randomSpeed = new Random();
            m_CurrentStoppedDreidelsCount = 0;
            m_CurrentBetLetter            = e.CurrentLetter;
            foreach (Dreidel dreidel in m_Dreidels)
            {
                dreidel.Spin(randomSpeed.Next(k_MinSpeed, k_MaxSpeed));
            }
        }
コード例 #2
0
        public override void Update(GameTime gameTime)
        {
            if (m_InputManager.IsKeyPressed(Keys.B) && !this.RoundStarted)
            {
                this.Bet                = "נ";
                m_BetLetter             = eLetters.Nes;
                this.DidPlayerGiveInput = true;
            }
            else if (m_InputManager.IsKeyPressed(Keys.D) && !this.RoundStarted)
            {
                this.Bet                = "ג";
                m_BetLetter             = eLetters.Gadol;
                this.DidPlayerGiveInput = true;
            }
            else if (m_InputManager.IsKeyPressed(Keys.V) && !this.RoundStarted)
            {
                this.Bet                = "ה";
                m_BetLetter             = eLetters.Haya;
                this.DidPlayerGiveInput = true;
            }
            else if (m_InputManager.IsKeyPressed(Keys.P) && !this.RoundStarted)
            {
                this.Bet                = "פ";
                m_BetLetter             = eLetters.Po;
                this.DidPlayerGiveInput = true;
            }
            else if (m_InputManager.IsKeyPressed(Keys.Space) && this.DidPlayerGiveInput && !this.RoundStarted)
            {
                OnSpin(new DreidelEventArgs(m_BetLetter));
                this.RoundStarted = true;
            }

            m_PlayerStatus         = string.Format("Score: {0}   Bet: {1}", this.Score.ToString(), this.Bet);
            this.Game.Window.Title = m_PlayerStatus;
            base.Update(gameTime);
        }
コード例 #3
0
 public DreidelEventArgs(eLetters i_CurrentLetter)
 {
     m_CurrentLetter = i_CurrentLetter;
 }