/// <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 } else if (SwinGame.KeyTyped(KeyCode.vk_LSHIFT)) { myGame.PlayerHit(0); Console.WriteLine("Im here as well..."); } else if (SwinGame.KeyTyped(KeyCode.vk_RSHIFT)) { myGame.PlayerHit(1); Console.WriteLine("Im here too..."); } } }
/// <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) { myGame.Start(); } } 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); } } }
// 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); } } }
/// <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(); //here the start working afther changing this } if (myGame.IsStarted) { if (SwinGame.KeyTyped(KeyCode.vk_LSHIFT) && SwinGame.KeyTyped (KeyCode.vk_RSHIFT)) { //Todo :add sound effects SwinGame.LoadSoundEffectNamed("F**k this shit Im out", "F**k this shit Im out.mp3"); SwinGame.PlaySoundEffect("F**k this shit Im out"); } 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("slap", "slap.wav"); SwinGame.PlaySoundEffect("slap"); } } }
/// <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.SpaceKey)) { myGame.Start(); } if (myGame.IsStarted) { if (SwinGame.KeyTyped(KeyCode.LeftShiftKey) && SwinGame.KeyTyped(KeyCode.RightShiftKey)) { //TODO: add sound effects } else if (SwinGame.KeyTyped(KeyCode.LeftShiftKey)) { myGame.PlayerHit(0); } else if (SwinGame.KeyTyped(KeyCode.RightShiftKey)) { myGame.PlayerHit(1); } } }
/// <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(); //gd:update FlipNextCard to Start to indicate the game to start } if (myGame.IsStarted) { if (SwinGame.KeyTyped(KeyCode.vk_LSHIFT) && SwinGame.KeyTyped(KeyCode.vk_RSHIFT)) { SwinGame.LoadSoundEffectNamed("Slap", "slap.wav"); SwinGame.PlaySoundEffect("Slap"); } if (SwinGame.KeyTyped(KeyCode.vk_LSHIFT)) { SwinGame.LoadSoundEffectNamed("Slap", "slap.wav"); SwinGame.PlaySoundEffect("Slap"); } if (SwinGame.KeyTyped(KeyCode.vk_RSHIFT)) { SwinGame.LoadSoundEffectNamed("Slap", "slap.wav"); SwinGame.PlaySoundEffect("Slap"); } } }
/// <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("Slap2players", "slap_2players.mp3"); SwinGame.PlaySoundEffect("Slap2players"); } else if (SwinGame.KeyTyped(KeyCode.vk_LSHIFT)) { myGame.PlayerHit(0); SwinGame.LoadSoundEffectNamed("Slapplayer0", "slap_player0.mp3"); SwinGame.PlaySoundEffect("Slapplayer0"); } else if (SwinGame.KeyTyped(KeyCode.vk_RSHIFT)) { myGame.PlayerHit(1); SwinGame.LoadSoundEffectNamed("Slapplayer1", "slap_player1.mp3"); SwinGame.PlaySoundEffect("Slapplayer1"); } } }
/// <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(); } if (myGame.IsStarted) { if (SwinGame.KeyTyped(KeyCode.vk_LSHIFT) && SwinGame.KeyTyped(KeyCode.vk_RSHIFT)) { //TODO: add sound effects SwinGame.LoadSoundEffectNamed("SameSlap", "sameslaptime.wav"); SwinGame.PlaySoundEffect("SameSlap"); } else if (SwinGame.KeyTyped(KeyCode.vk_LSHIFT)) { myGame.PlayerHit(0); SwinGame.LoadSoundEffectNamed("DiffSlap", "diffslaptime.wav"); SwinGame.PlaySoundEffect("DiffSlap"); } else if (SwinGame.KeyTyped(KeyCode.vk_RSHIFT)) { myGame.PlayerHit(1); SwinGame.LoadSoundEffectNamed("DiffSlap", "diffslaptime.wav"); SwinGame.PlaySoundEffect("DiffSlap"); } } }
/// <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"); } } }
/// <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)) { //todoo: add sound effects SwinGame.PlaySoundEffect("Slap"); } else if (SwinGame.KeyTyped(KeyCode.vk_LSHIFT)) { myGame.PlayerHit(0); SwinGame.PlaySoundEffect("Slap"); } else if (SwinGame.KeyTyped(KeyCode.vk_RSHIFT)) { myGame.PlayerHit(1); SwinGame.PlaySoundEffect("Slap"); } } }
/// <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 (); //change it to start the game myGame.Start(); } if (myGame.IsStarted) { if (SwinGame.KeyTyped(KeyCode.vk_LSHIFT) && SwinGame.KeyTyped(KeyCode.vk_RSHIFT)) { //Add sound effects //SwinGame.LoadSoundEffect("Slap"); } else if (SwinGame.KeyTyped(KeyCode.vk_LSHIFT)) { myGame.PlayerHit(0); } else if (SwinGame.KeyTyped(KeyCode.vk_RSHIFT)) { myGame.PlayerHit(1); } } }
/// <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.isStared) { if( (SwinGame.KeyTyped)(Keycode.vk_LSHIFT) && (SwinGame.KeyTyped)(Keycode.vk_RSHIFT)) { } else if ((SwinGame.KeyTyped) (Keycode.vk_LSHIFT)) { myGame.PlayerHit(0); } else if (SwinGame.KeyTyped) (Keycode.vk_RSHIFT)) { myGame.PlayerHit(1); } } }
/// <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.LoadSoundEffectNamed("Slap2", "Resources/sounds/slap1.mp3"); SwinGame.PlaySoundEffect("Slap2"); } else if (SwinGame.KeyTyped(KeyCode.vk_LSHIFT)) { myGame.PlayerHit(0); SwinGame.LoadSoundEffectNamed("Slap1", "Resources/sounds/slap1.mp3"); SwinGame.PlaySoundEffect("Slap1"); } else if (SwinGame.KeyTyped(KeyCode.vk_RSHIFT)) { myGame.PlayerHit(1); SwinGame.LoadSoundEffectNamed("Slap1", "Resources/sounds/slap1.mp3"); SwinGame.PlaySoundEffect("Slap1"); } } }
/// <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.LoadSoundEffectNamed("Beep", "beep.wav"); SwinGame.PlaySoundEffect("Beep"); //TODO: add sound effects } else if (SwinGame.KeyTyped(KeyCode.vk_LSHIFT)) { SwinGame.LoadSoundEffectNamed("Slap", "slap.wav"); SwinGame.PlaySoundEffect("Slap"); myGame.PlayerHit(0); } else if (SwinGame.KeyTyped(KeyCode.vk_RSHIFT)) { SwinGame.LoadSoundEffectNamed("Slap2", "slap2.wav"); SwinGame.PlaySoundEffect("Slap2"); myGame.PlayerHit(1); } } }
/// <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); } } }
/// <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 } else if (SwinGame.KeyTyped(KeyCode.vk_LSHIFT)) { Console.WriteLine("shift pressed left "); myGame.PlayerHit(0); } else if (SwinGame.KeyTyped(KeyCode.vk_RSHIFT)) { Console.WriteLine("shift pressed right "); myGame.PlayerHit(1); } Console.WriteLine"blah blah"); } }
/// <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); } } }
/// <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(); // Starts the game } 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); // User hits first card } else if (SwinGame.KeyTyped(KeyCode.vk_RSHIFT)) { myGame.PlayerHit(1); // User hits second card } } }
/// <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.LoadSoundEffectNamed("Collide", "collide.wav"); SwinGame.PlaySoundEffect("Collide"); } else if (SwinGame.KeyTyped(KeyCode.vk_LSHIFT)) { myGame.PlayerHit(0); SwinGame.LoadSoundEffectNamed("Snap", "snapping.wav"); SwinGame.PlaySoundEffect("Snap"); } else if (SwinGame.KeyTyped(KeyCode.vk_RSHIFT)) { myGame.PlayerHit(1); SwinGame.LoadSoundEffectNamed("Break", "break.wav"); SwinGame.PlaySoundEffect("Break"); } } }
/// <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(); } 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); } } }
/// <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(); } }
/// <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(); //starts the game instead of flipping the cards } }
/// <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} else if (SwinGame.KeyTyped (KeyCode.vk_LSHIFT)){ myGame.PlayerHit (0); } Note: Watch out, git commit -am "..." will not add any new files. So only use this if you have just changed existing files. } else if (SwinGame.KeyTyped(KeyCode.vk_RSHIFT)) { myGame.PlayerHit(1); } } }
/// <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)) { //Flips to the next card myGame.Start(); } //Mubashir Code (Team Leader) if (myGame.IsStarted) { if (SwinGame.KeyTyped(KeyCode.vk_LSHIFT) && SwinGame.KeyTyped(KeyCode.vk_RSHIFT)) { //NOTHING HAPPENS //ADD SOUND EFFECTS HERE (MARCUS LAI CODE FIX) SwinGame.LoadSoundEffectNamed("Slap1", "Slap_Sound.wav"); SwinGame.PlaySoundEffect("Slap1"); } else if (SwinGame.KeyTyped(KeyCode.vk_LSHIFT)) { myGame.PlayerHit(0); SwinGame.LoadSoundEffectNamed("Slap2", "Sharp_Punch.wav"); SwinGame.PlaySoundEffect("Slap2"); } else if (SwinGame.KeyTyped(KeyCode.vk_RSHIFT)) { myGame.PlayerHit(1); SwinGame.LoadSoundEffectNamed("Slap3", "Strong_Punch.wav"); SwinGame.PlaySoundEffect("Slap3"); } } }