Good day to all who is reading this.
I am designing a Turn Based Strategy (TBS) game called "LifeTime of Human War" you can play this game on Construct 2 -> Arcade -> Strategy Games, there you can see what the game is about and how it is played.
The game is operational but in the designing of this game I am facing two major problems with Player and AI maintenance. To see the issue in the image files below.
The Player Control and Fight Army
The AI Control and Fight Army
As you can see in order for the game to work, it is required to program each individual sprite (in this case Army), their conditions and actions according to what triggers those events to occur. This required an immense amount of copy and paste the same code and rewriting them according to each of the sprites needed conditions.
And as seen in the game and the code images provided above, it is an ineffective and inefficient way of designing this game, as this raises maintenance issues.
I have tried using families but AI would fight it own self. Tried creating invisible objects that would attach itself to each AI every other turn and another for the Player, but that raised issues in destroying that invisible object to pinned to sprite and issues with game resource management.
So, basically I am stuck with this issue of maintaining my code in being efficient. Any help or suggestions would be greatly appreciated, an example of your solutions would also be of great use in designing this game.
Thank-you for reading this and really would appreciate your help.