Guest User

Sound code held together by gum and tape

a guest
Nov 21st, 2020
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //movement
  2. hinput = keyboard_check(ord("D")) - keyboard_check(ord("A"));
  3. vinput = keyboard_check(ord("S")) - keyboard_check(ord("W"));
  4.  
  5. if(hinput != 0 or vinput != 0){
  6.  
  7.     p1dir = point_direction(0, 0, hinput, vinput);
  8.     p1movex = lengthdir_x(p1spd, p1dir);
  9.     p1movey = lengthdir_y(p1spd, p1dir);
  10.    
  11.     x += p1movex;
  12.     y += p1movey;
  13. }
  14.  
  15. //sound
  16. if(keyboard_check(ord("W") != 1)){
  17.     if (audio_is_paused(sfx_tankmove)){
  18.         audio_resume_sound(sfx_tankmove);
  19.     }
  20.     else{
  21.         if (!audio_is_playing(sfx_tankmove)){
  22.             audio_play_sound(sfx_tankmove, 0, 0);
  23.         }
  24.     }
  25. }
  26. else{
  27.     if (audio_is_playing(sfx_tankmove)){
  28.         audio_pause_sound(sfx_tankmove);
  29.     }
  30. }
  31.  
Advertisement
Add Comment
Please, Sign In to add comment