I am working on some sort of a football manager game. I have a huge list of players and their stats (everyone has 6 stats for now) that I keep in array format and an inventory array for the 11 players that will start the match.
Now I want to create a squad screen with players formations like this;
and when I click the profile icon, I want to show a list of available players. I managed to paste players' info in a section like this;
but I want to show a list, formed with this format, automatically for all the available players in the database.
Right now I am using this to write down stats for one single player;
As you can see, it has 7 different objects + the button to select.
It simply feels wrong to create hundreds of objects for a list that goes on like this (and I know that list will have way more than 4 players);
Step by step:
- User sees a squad list (first screenshot)
- User clicks on any of the players that he wants to change
- User sees a list of all the available players that is suitable for this position (each player has the format from the second screenshot. If there are 3 players available, 3 players shown, if there are 100 players available, 100 players shown)
- User chooses a player from the list (click ok)
- Selected player is on previously selected position
I hope it's all clear and I hope someone else faced this problem and solved it before.