R
Ryan Blaney
Guest
Ok, I'm making an RPG game with a unique battle system. The problem is, the enemy can only do one attack at a time. I have a value called attack, which sets the alarm between the warning animation and the enemy attack animation. I am trying to set the attack equal to false after the alarm is finished so the other attack can happen, but if i do that, the alarm continuously goes up and never decreases. Can anyone think of a fix?
Step Event:
if (attack == true) {
alarm[0] = atkdel;
attack = false;
}
Alarm[0] Event:
instance_create_depth(xwarn, ywarn, 0, warntype);
show_debug_message("Worked");
audio_play_sound(wasound, 0, false);
if (instance_exists(obj_player) && obj_player.CurrentTile == warntile) {
if (!invincibility) {
obj_player.hp -= enemyStrength;
obj_battle_layout.alarm[1] = invincibilitySpeed;
invincibility = true;
if (obj_player.hp <= 0) {
obj_player.hp = 0;
playerDead = true;
}
}
}
warntype.alarm[0] = atkspd;
Step Event:
if (attack == true) {
alarm[0] = atkdel;
attack = false;
}
Alarm[0] Event:
instance_create_depth(xwarn, ywarn, 0, warntype);
show_debug_message("Worked");
audio_play_sound(wasound, 0, false);
if (instance_exists(obj_player) && obj_player.CurrentTile == warntile) {
if (!invincibility) {
obj_player.hp -= enemyStrength;
obj_battle_layout.alarm[1] = invincibilitySpeed;
invincibility = true;
if (obj_player.hp <= 0) {
obj_player.hp = 0;
playerDead = true;
}
}
}
warntype.alarm[0] = atkspd;