Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Create Event Variables
- Attack2 = false;
- Attack3 = false;
- can_attack = true;
- Key_Attack = false;
- //Alarm0 1 and 2
- sprite_index = Stone_Middle;
- Attack2 = false;
- Attack3 = false;
- //Alarm3
- can_attack = true;
- Key_Attack = false;
- //Step Event
- //Regular Movement Variables
- Key_Left = keyboard_check_direct (vk_left);
- Key_Right = keyboard_check_direct (vk_right);
- if can_attack and keyboard_check_pressed (ord('X'))
- {
- Key_Attack = true;
- can_attack = false;
- alarm[3]= 10; // your delay between key presses
- }
- //Regular Movement
- if (Key_Left)
- {
- image_xscale = -1;
- x = obj_player.x + xOff_temp
- }
- else
- {
- if (Key_Right)
- {
- image_xscale = 1;
- x = obj_player.x - xOff_temp
- }
- }
- y = obj_player.y + yOff_temp
- //Weapon sprites must have precise collision turned on to be effective
- if (Key_Attack) && (Attack2 = false) && (Attack3 = false)
- {
- Attack2 = true;
- sprite_index = player_djump;
- if alarm[0]=-1 alarm = 50;
- }
- else
- {
- if (Key_Attack) && (Attack2 = true)
- {
- Attack2 = false;
- Attack3 = true;
- image_index = 0;
- sprite_index = player_idle;
- image_speed = 0.125
- if alarm[1]=-1 alarm = 50;
- }
- else
- {
- if (Key_Attack) && (Attack3 = true)
- {
- Attack3 = false;
- image_index = 0;
- sprite_index = player_slash;
- image_speed = 0.125
- if alarm[2]=-1 alarm = 100;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement