Advertisement
Guest User

Attacking Animations

a guest
Jun 6th, 2014
830
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Variables
  2. x = obj_player.x
  3. y = obj_player.y
  4. xOff_temp = -50 //movement to max pan
  5. yOff_temp = 0
  6. Swipe2 = false;
  7. Swipe3 = false;
  8.  
  9. //Step Event
  10. //Regular Movement Variables
  11. Key_Left  = keyboard_check_direct (vk_left);
  12. Key_Right = keyboard_check_direct (vk_right);
  13. Key_Attack = keyboard_check_pressed (ord('X'));
  14.  
  15. //Regular Movement
  16. if (Key_Left)
  17. {
  18.     image_xscale = -1;
  19.     x = obj_player.x + xOff_temp
  20. }
  21. else
  22. {
  23.     if (Key_Right)
  24.     {
  25.         image_xscale = 1;
  26.         x = obj_player.x - xOff_temp
  27.     }
  28. }
  29.  
  30. y = obj_player.y + yOff_temp
  31.  
  32. //Attacking
  33. if Key_Attack
  34. {
  35.     sprite_index = player_djump
  36.     Swipe2 = true;
  37. }
  38. else
  39. {
  40.     if (Key_Attack) && (Swipe2 = true)
  41.     {
  42.     sprite_index = player_run;
  43.     Swipe3 = true;
  44.     }
  45. }
  46.  
  47. if (Key_Attack) && (Swipe3 = true)
  48. {
  49.     sprite_index = player_idle;
  50. }
  51.  
  52.  
  53. if Swipe2 = true
  54. {
  55.     alarm[0]=-1 alarm = 60;
  56. }
  57.  
  58. if Swipe3 = true
  59. {
  60.     alarm[1]=-1 alarm = 60;
  61. }
  62.  
  63. //Alarm0
  64. Swipe2 = false;
  65.  
  66. //Alarm1
  67. Swipe2 = false;
  68. Swipe3 = false;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement