I am running a loop and I want a jQuery function to happen before the loop continues. here is an example.
var battle=true;
while(battle){
$('.action1').click(n=0);
$('.action2').click(n=1);
$('.action3').click(n=2);
$('.action4').click(n=3);
action[n]
etc....
}
I am currently making a text based rpg game. Whenever user input was needed I would use a prompt() and whenever user information was given I would use an alert().
is there some way for me to have the while loop progress through receiving user input and giving input result by the user clicking on html elements?