Hi
I try modify a little
this code by adding a LMB & RMB combination (LMB - left mouse button, RMB - right mouse button). I have something like this:
player.c
if(mouse_left == 0 && mouse_left_press == 1) mouse_left_press = 0;
if(mouse_left == 1 && mouse_left_press == 0 && my.animblend >= stand)
{
mouse_left_press = 1;
my.blendframe = punch_a;
if(my.jumping_mode == 1) airborne_punch = 1;
else airborne_punch = 0;
my.movement_mode = 1;
combo_continue = 0;
}
if(mouse_right == 0 && mouse_right_press == 1) mouse_right_press = 0;
if(mouse_right == 1 && mouse_right_press == 0 && my.animblend >= stand)
{
mouse_right_press = 1;
my.blendframe = punch_f;
if(my.jumping_mode == 1) airborne_punch = 1;
else airborne_punch = 0;
my.movement_mode = 1;
combo_continue = 0;
}
}
//
if(my.movement_mode == 1)
{
if(my.jumping_mode != 10) my.jumping_mode = 0;
else if(my.animate >= 60 && my.animblend >= stand) my.jumping_mode = 0;
//
if(mouse_left == 0 && mouse_left_press == 1)
mouse_left_press = 0;
if(mouse_left == 1 && mouse_left_press == 0 && my.animate >= 30 && combo_continue == 0)
{ mouse_left_press = 1; combo_continue = 1; }
if(mouse_right == 0 && mouse_right_press == 1)
mouse_right_press = 0;
if(mouse_right == 1 && mouse_right_press == 0 && my.animate >= 30 && combo_continue == 0)
{ mouse_right_press = 1; combo_continue = 2; }
}
//
if(my.movement_mode == 2)
{
my.jumping_mode = 0;
if(mouse_left == 0 && mouse_left_press == 1)
mouse_left_press = 0;
if(mouse_left == 1 && mouse_left_press == 0 && my.animate >= 30 && combo_continue == 0)
{ mouse_left_press = 1; combo_continue = 1; }
if(mouse_right == 0 && mouse_right_press == 1)
mouse_right_press = 0;
if(mouse_right == 1 && mouse_right_press == 0 && my.animate >= 30 && combo_continue == 0)
{ mouse_right_press = 1; combo_continue = 2; }
}
}
and animation.c
ent_animate(my,"punch_b",100,0);
my.animate = 100;
my.blendframe = stand;
if(my.moving == 1)
{
if(key_shift == 1) my.blendframe = walk;
else my.blendframe = run;
}
if(combo_continue == 1)
{
combo_continue = 0;
my.blendframe = punch_c;
}
else
my.movement_mode = 0;
if (combo_continue == 2)
{
combo_continue = 0;
my.blendframe = punch_f;
}
else
my.movement_mode = 0;
}
How`s it working? Not working, that`s a problem... Well, it should be working something like this:
when I have a punch_b animation and press LMB, then combo_continue = 1 and play animation punch_c, and when I press RMB then set combo_continue = 2 and play animation punch_f, after that finish the sequence. It`s simple, but I don`t know why it`s not working
Can anybody help me resolve this problem? Thank you and sorry for my english. I hope you can understand me.