Ejemplo 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.Start();


                myGame.FlipNextCard();
            }

            {
                if (SwinGame.KeyTyped(KeyCode.vk_LSHIFT) &&
                    SwinGame.KeyTyped(KeyCode.vk_RSHIFT))
                {
                    //SwinGame.LoadSoundEffectNamed ("Error", "error.wav");
                    SwinGame.PlaySoundEffect("error.wav");
                }
                else if (SwinGame.KeyTyped(KeyCode.vk_LSHIFT))
                {
                    myGame.PlayerHit(0);
                }
                else if (SwinGame.KeyTyped(KeyCode.vk_RSHIFT))
                {
                    myGame.PlayerHit(1);
                }
            }
        }
Ejemplo 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.FlipNextCard();
            }
            //INSETED CODE JC
            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);
                }
            }
        }
Ejemplo 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.FlipNextCard();
                myGame.Start();                  //Add by Chua Chung Long
            }
            if (myGame.IsStarted)                //Add by Loh Yong Jun
            {
                if (SwinGame.KeyTyped(KeyCode.vk_LSHIFT) &&
                    SwinGame.KeyTyped(KeyCode.vk_RSHIFT))
                {
                    SwinGame.StopSoundEffect("Slap");
                    SwinGame.LoadSoundEffectNamed("Error", "Resources/sounds/error.wav");                      //Add by Loh Yong Jun
                    SwinGame.PlaySoundEffect("Error");                                                         //Add by Loh Yong Jun
                    //TODO: add sound effects
                }
                else if (SwinGame.KeyTyped(KeyCode.vk_LSHIFT))
                {
                    myGame.PlayerHit(0);
                }
                else if (SwinGame.KeyTyped(KeyCode.vk_RSHIFT))
                {
                    myGame.PlayerHit(1);
                }
            }
        }
Ejemplo 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();
                myGame.FlipNextCard();
            }

            if (myGame.IsStarted)
            {
                if (SwinGame.KeyTyped(KeyCode.vk_LSHIFT) && SwinGame.KeyTyped(KeyCode.vk_RSHIFT))
                {
                    SwinGame.LoadSoundEffectNamed("Error", "Sad_Trombone-Joe_Lamb-665429450.wav");
                    SwinGame.PlaySoundEffect("Error");
                }
                else if (SwinGame.KeyTyped(KeyCode.vk_LSHIFT))
                {
                    myGame.PlayerHit(0);
                    SwinGame.LoadSoundEffectNamed("Slap", "Slap-Soundmaster13-49669815.wav");
                    SwinGame.PlaySoundEffect("Slap");
                }
                else if (SwinGame.KeyTyped(KeyCode.vk_RSHIFT))
                {
                    myGame.PlayerHit(1);
                    SwinGame.LoadSoundEffectNamed("Clang", "Metal Clang-SoundBible.com-19572601.wav");
                    SwinGame.PlaySoundEffect("Clang");
                }
            }
        }
Ejemplo n.º 5
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();
                myGame.FlipNextCard();
            }

            if (myGame.IsStarted)
            {
                if (SwinGame.KeyTyped(KeyCode.vk_LSHIFT) &&
                    SwinGame.KeyTyped(KeyCode.vk_RSHIFT))
                {
                    SwinGame.LoadSoundEffectNamed("laugh", "laugh.wav");
                    SwinGame.PlaySoundEffect("laugh");
                }
                else if (SwinGame.KeyTyped(KeyCode.vk_LSHIFT))
                {
                    SwinGame.LoadSoundEffectNamed("Snap", "snap.wav");
                    SwinGame.PlaySoundEffect("Snap");
                    myGame.PlayerHit(0);
                }
                else if (SwinGame.KeyTyped(KeyCode.vk_RSHIFT))
                {
                    SwinGame.LoadSoundEffectNamed("Snap2", "snap2.wav");
                    SwinGame.PlaySoundEffect("Snap2");
                    myGame.PlayerHit(1);
                }
            }
        }
Ejemplo n.º 6
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();
                myGame.FlipNextCard();
            }

            if (myGame.IsStarted)
            {
                if (SwinGame.KeyTyped(KeyCode.vk_LSHIFT) &&
                    SwinGame.KeyTyped(KeyCode.vk_RSHIFT))
                {
                    SwinGame.OpenAudio();
                    SwinGame.LoadSoundEffectNamed("Ding", "ding.wav");
                    SwinGame.PlaySoundEffect("Ding");
                    SwinGame.Delay(2000);
                    SwinGame.CloseAudio();
                }
                else if (SwinGame.KeyTyped(KeyCode.vk_LSHIFT))
                {
                    myGame.PlayerHit(0);
                }
                else if (SwinGame.KeyTyped(KeyCode.vk_RSHIFT))
                {
                    myGame.PlayerHit(1);
                }
            }
        }
Ejemplo n.º 7
0
        // Something
        /// <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();
                myGame.FlipNextCard();
            }

            if (myGame.IsStarted)
            {
                if (SwinGame.KeyTyped(KeyCode.vk_LSHIFT) || SwinGame.KeyTyped(KeyCode.vk_RSHIFT))
                {
                    SwinGame.PlaySoundEffect("Slap");
                }
                if (SwinGame.KeyTyped(KeyCode.vk_LSHIFT))
                {
                    myGame.PlayerHit(0);
                }
                if (SwinGame.KeyTyped(KeyCode.vk_RSHIFT))
                {
                    myGame.PlayerHit(1);
                }
            }
        }
Ejemplo n.º 8
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)
 {
     SwinGame.ProcessEvents();
     if (SwinGame.KeyTyped(KeyCode.vk_SPACE))
     {
         myGame.FlipNextCard();
     }
 }
Ejemplo n.º 9
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();
            }
        }