Do you know how to make combos, i tried with this code but the sprite doesnt change
{
if(keyboard_check_pressed(vk_space)) and facing=1
{
alarm[1] = 90;
combo1 += 1;
if combo1 = 1{
sprite_index = spr_thanatos_atk_1_sword_right
image_index=0;
}
if combo1 = 2{
sprite_index = spr_thanatos_atk_1_sword_right_2
image_index=0;
}
if combo1 > 3{
combo1 = 0;
}
}
if(sprite_index == spr_thanatos_atk_1_sword_right && image_index == 6)
{
sprite_index = spr_thanatos_stand_right;
Help with combo animation
Started by daro0196, May 28 2012 06:51 PM
2 replies to this topic
#1
Posted 28 May 2012 - 06:51 PM
#2
Posted 28 May 2012 - 09:27 PM
You are setting alarm1 to 90 each time space is pressed and facing = 1.
Alarms events trigger when they reach zero and they are then set to -1. Testing if the alarm has already been set may solve your problem.
Alarms events trigger when they reach zero and they are then set to -1. Testing if the alarm has already been set may solve your problem.
if(keyboard_check_pressed(vk_space) && facing == 1){
if(alarm[1] == -1){
alarm[1] = 90;
combo1 += 1;
}
if (combo1 == 1){
sprite_index = spr_thanatos_atk_1_sword_right
image_index=0;
}
if (combo1 == 2){
sprite_index = spr_thanatos_atk_1_sword_right_2
image_index=0;
}
if (combo1 > 3){
combo1 = 0;
}
}
if(sprite_index == spr_thanatos_atk_1_sword_right && image_index == 6){
sprite_index = spr_thanatos_stand_right;
}
No way of testing this as you didn't say what is in Alarm1 event but shouldn't if (combo1 > 3) be if (combo1 > 2) ???
#3
Posted 29 May 2012 - 12:57 AM
You are setting alarm1 to 90 each time space is pressed and facing = 1.
Alarms events trigger when they reach zero and they are then set to -1. Testing if the alarm has already been set may solve your problem.if(keyboard_check_pressed(vk_space) && facing == 1){ if(alarm[1] == -1){ alarm[1] = 90; combo1 += 1; } if (combo1 == 1){ sprite_index = spr_thanatos_atk_1_sword_right image_index=0; } if (combo1 == 2){ sprite_index = spr_thanatos_atk_1_sword_right_2 image_index=0; } Thanks for the help but it didnt worked, in alarm one the evente changes combo1 to 0 and if i press space it keeps doing the first animation.... if (combo1 > 3){ combo1 = 0; } } if(sprite_index == spr_thanatos_atk_1_sword_right && image_index == 6){ sprite_index = spr_thanatos_stand_right; }No way of testing this as you didn't say what is in Alarm1 event but shouldn't if (combo1 > 3) be if (combo1 > 2) ???
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











