Exemplo n.º 1
0
		/// <summary>
		/// Respond to the user input -- with requests affecting myGame
		/// </summary>
		/// <param name="myGame">The game object to update in response to events.</param>
		private static void HandleUserInput (Snap myGame)
		{
			//Fetch the next batch of UI interaction
			SwinGame.ProcessEvents ();

			if (SwinGame.KeyTyped (KeyCode.vk_SPACE))
			{
				myGame.FlipNextCard ();

				if (myGame.IsStarted)
				{
					if (SwinGame.KeyTyped (KeyCode.vk_LSHIFT) &&
					    SwinGame.KeyTyped (KeyCode.vk_RSHIFT))
					{
						//TODO: add sound effects
					}
					else if (SwinGame.KeyTyped (KeyCode.vk_LSHIFT))
					{
						myGame.PlayerHit (0);
					}
					else if (SwinGame.KeyTyped (KeyCode.vk_RSHIFT))
					{
						myGame.PlayerHit (1);
					}
				} 
			}
		}
Exemplo n.º 2
0
        /// <summary>
        /// Respond to the user input -- with requests affecting myGame
        /// </summary>
        /// <param name="myGame">The game object to update in response to events.</param>
        private static void HandleUserInput(Snap myGame)
        {
            //Fetch the next batch of UI interaction
            SwinGame.ProcessEvents();

            if (SwinGame.KeyTyped (KeyCode.vk_SPACE))
            {
                myGame.Start ();
            }
            if(myGame.IsStarted)
            {
                if(SwinGame.KeyTyped (KeyCode.vk_LSHIFT) &&SwinGame.KeyTyped (KeyCode.vk_RSHIFT))
                {
                    SwinGame.PlaySoundEffect ("Slap");
                }
                else if(SwinGame.KeyTyped (KeyCode.vk_LSHIFT))
                {
                    myGame.PlayerHit (0);
                }
                else if (SwinGame.KeyTyped (KeyCode.vk_RSHIFT))
                {
                    myGame.PlayerHit (1);
                }
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Respond to the user input -- with requests affecting myGame
        /// </summary>
        /// <param name="myGame">The game object to update in response to events.</param>
        private static void HandleUserInput(Snap myGame)
        {
            //Fetch the next batch of UI interaction
            SwinGame.ProcessEvents();

            if (SwinGame.KeyTyped (KeyCode.vk_SPACE))
            {
                myGame.Start ();
            }

            if (myGame.IsStarted)
            {
                if ( SwinGame.KeyTyped (KeyCode.vk_LSHIFT) &&
                    SwinGame.KeyTyped (KeyCode.vk_RSHIFT))
                {
                    //TODO: add sound effects
                    SwinGame.LoadSoundEffectNamed("Buzz","Buzz.wav");
                    SwinGame.PlaySoundEffect("Buzz");
                }
                else if (SwinGame.KeyTyped (KeyCode.vk_LSHIFT))
                {
                    myGame.PlayerHit (0);
                    SwinGame.LoadSoundEffectNamed("Slap","Slap.wav");
                    SwinGame.PlaySoundEffect("Slap");
                }
                else if (SwinGame.KeyTyped (KeyCode.vk_RSHIFT))
                {
                    myGame.PlayerHit (1);
                    SwinGame.LoadSoundEffectNamed("Slap2","Slap2.wav");
                    SwinGame.PlaySoundEffect("Slap2");
                }
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Respond to the user input -- with requests affecting myGame
        /// </summary>
        /// <param name="myGame">The game object to update in response to events.</param>
        private static void HandleUserInput(Snap myGame)
        {
            //Fetch the next batch of UI interaction
            SwinGame.ProcessEvents();

            if (SwinGame.KeyTyped (KeyCode.vk_SPACE))
            {
                myGame.Start ();
            }
            <<<<<<< HEAD

            =======

            if (myGame.IsStarted)
            {
                if (SwinGame.KeyTyped (KeyCode.vk_LSHIFT) &&
                    SwinGame.KeyTyped (KeyCode.vk_RSHIFT))
                {
                    //Insert sound here
                    //Personal note: Pretty sure sound here will never play unless both
                }
                else if (SwinGame.KeyTyped (KeyCode.vk_LSHIFT))
                {
                    myGame.PlayerHit (0);
                }
                else if (SwinGame.KeyTyped (KeyCode.vk_RSHIFT))
                {
                    myGame.PlayerHit (1);
                }
            }

            >>>>>>> add-player-hit
        }