I’m currently doing a battle system similar to Last Remnant’s “Union turn based battle system” and I’m having trouble with each of the character doing a linear attack.
I have 1 Union(group) that consists of 4 characters and another Union that consist of 4 enemies. So I placed them in 2 different arrays like this:
var Union1: GameObject;
var EnimUnion1: GameObject;
The closest so far that I’ve done is a nested for loop like this
for(var i:int 0; i < 2; i++){
for(var x:int 0; i < 2; x++){
print("Character"+i+"attacks Enemy "+x);
}
}
what this does is: the Character 0 attacks Enemy 0 and 1, and Character 1 attacks Enemy 0 and 1.
How do I make them attack the enemy once? Is there another loop to make it possible?