Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //variables because fuck typing
- p1w = keyboard_check(ord("W"));
- p1a = keyboard_check(ord("A"));
- p1s = keyboard_check(ord("S"));
- p1d = keyboard_check(ord("D"));
- //movement
- hinput = p1d - p1a;
- vinput = p1s - p1w;
- if(hinput != 0 or vinput != 0){
- p1dir = point_direction(0, 0, hinput, vinput);
- p1movex = lengthdir_x(p1spd, p1dir);
- p1movey = lengthdir_y(p1spd, p1dir);
- x += p1movex;
- y += p1movey;
- }
- //sound
- //why does this even work
- if((p1w) or (p1a) or (p1s) or (p1d) = 1){
- if (audio_is_paused(sfx_tankmove)){
- audio_resume_sound(sfx_tankmove);
- }
- else{
- if (!audio_is_playing(sfx_tankmove)){
- audio_play_sound(sfx_tankmove, 0, 0);
- }
- }
- }
- else{
- if (audio_is_playing(sfx_tankmove)){
- audio_pause_sound(sfx_tankmove);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment