Wolfpack150 / BaseballProject

1 stars 0 forks source link

Runners on base #8

Closed bvlundberg closed 9 years ago

bvlundberg commented 9 years ago

In the Gameplay class, I was thinking about having variables like first, second, third to hold players at certain bases on the field. Does anyone have a better suggestion?

bvlundberg commented 9 years ago

During the last lab period, we discussed how to take care of players at particular bases on the field. We decided the best way to handle this would be by allowing an array to hold players at certain bases. So, the array will be constructed like this: Element 0- Current Hitter Element 1- Runner on First Element 2- Runner on Second Element 3- Runner on Third Element 4- Runner at Home (Runner scored)

We need to create this array in the gameplay class. In order to use this array, we need to create functions that will move players through the array, including incrementBase and decrementBase that will move a player one base at a time. Since we are also relying on the user to move all players EXCEPT the current hitter, we will need a function that will allow the user to drag a player to the correct base, which will also move players move bases 1 by 1.

Since Hani is the only one not assigned to anything at the moment, I am giving him this task. I know there are a lot of things in these functions that we do not currently know yet, such as dragging players or inputs to certain functions based on buttons, so just write these fucntions generically and don't try to run them with any kind of input. Set up the functions so that when we do know the input we can do it. I recommend looking up information on dragging objects in Android Studios. Maybe you will be able to help the group understand how that functionality works.