function handle_attack()
{
if(player.animaten_mode == 2)
{
if (mouse_left_pressed == 0)
{
var attack_percentage = 0;
while(attack_percentage < 100)
{
ent_animate(player,NULL,0,0);
ent_animate(player,"oneh_attack_a",attack_percentage,ANM_ADD);
attack_percentage += 10 * time_step;
mouse_left_pressed = 1;
mouse_left = 0;
if(attack_percentage>50 && attack_percentage<85) {player.attacking = 1;}else{player.attacking = 0;}
wait (1);
}
player.attacking = 0;
mouse_left = 0;
mouse_left_pressed = 2;
}
if (mouse_left == 1 && mouse_left_pressed == 2)
{
var attack_percentage = 0;
while(attack_percentage < 100)
{
ent_animate(player,NULL,0,0);
ent_animate(player,"oneh_attack_b",attack_percentage,ANM_ADD);
attack_percentage += 10 * time_step;
mouse_left_pressed = 2;
mouse_left = 0;
if(attack_percentage>5 && attack_percentage<60) {player.attacking = 1;}else{player.attacking = 0;}
wait (1);
}
player.attacking = 0;
mouse_left = 0;
mouse_left_pressed = 0;//if you write mouse_left_pressed = 2, you can add easily more attacks
}
}
}