B
BubbleMage123
Guest
Hello,
I am making a platformer-melee game controlled by mouse only. My goal is to create the combo attacks before I leave my pre-alpha stage of the game, but I'm having some troubles. I have been debugging this for about a week, and tutorials and other posts did not help much. Basically, what's happening now is my character will only punch. If I click really fast, it sometimes shows the first frame of the kick before switching back to stage 0. My code relating to this issue is below:
Paige Moves:
Paige Brawl:
Paige Animation end:
Paige Sprites
I feel like I'm doing something terribly wrong with the alarms, as I've tried three different methods (all of which have failed). Thanks for the support; any help is appreciated!
I am making a platformer-melee game controlled by mouse only. My goal is to create the combo attacks before I leave my pre-alpha stage of the game, but I'm having some troubles. I have been debugging this for about a week, and tutorials and other posts did not help much. Basically, what's happening now is my character will only punch. If I click really fast, it sometimes shows the first frame of the kick before switching back to stage 0. My code relating to this issue is below:
Paige Moves:
Code:
///Paige_Moves();
brawl_check = false;
if(mouse_button == mb_right && distance_to_point(mouse_x,mouse_y) == 0){
State = e_state.blocking;
}else if(State = e_state.blocking && mouse_check_button_released(mb_right)){
State = e_state.normal;
}else if (
(mouse_button == mb_right) &&
(distance_to_point(mouse_x,mouse_y) != 0) &&
(State != e_state.blocking) &&
(State != e_state.brawling)){
State = e_state.brawling;
brawl_check = true;
}
if(State = e_state.brawling && brawl_check){
//stage = 0;
Paige_Brawl();
//brawl_check = false;
}
Code:
///Paige_Brawl();
var combo_ready = mouse_check_button_pressed(mb_right) && (distance_to_point(mouse_x,mouse_y) != 0);
var clicks = 1;
stage = clicks - 1;
//if(clicks > 3) clicks = 0; State = e_state.normal;
if(can_switch_stage){
if(combo_ready){
clicks += 1;
can_switch_stage = false;
alarm_set(1,-1);
}
}
Code:
///For death scene
if(State == e_state.dead){
...
}else if(State == e_state.brawling){
can_switch_stage = true;
alarm[1] = 10;
}
Code:
if((!is_hurt) && (State != e_state.dead) && (State != e_state.blocking) && (State != e_state.brawling)){
...
} else if(is_hurt){
sprite_index = Paige_Hurt;
} else if(State == e_state.dead){
sprite_index = Paige_Dead;
image_speed = 0.2;
} else if(State == e_state.blocking){
sprite_index = Paige_Blocking;
image_speed = 0.03;
} else if(State == e_state.brawling){
image_speed = 0.2;
sprite_index = brawl[stage];
if (can_switch_stage){sprite_index = Paige_Idle;}
}