Baseball game dev diary V0.5.3.202012090015 Giving the base buttons meaning
- Disabled base buttons at beginning of plate appearance unless occupied.
- Remove the code to reset bases in StartGame as that procedure called ResetGame procedure, which called ResetBases anyway.
- Base buttons now display some player info when clicked, by searching for the playerID within the array of objects.
- Added public variable for squadSize instead of hardcoding 28 into several places in code.
- All player statuses set to 3 (benched) at start of game. Changed to 1 when put into game.
- Lineups now populate from squads array of player class objects with random players, not just first nine. Used a while loop to generate a random number up to squadSize and if player status was not 3, repeat random number generation.
Ended up spending a lot longer than intended on this one (about 3 hours). Worth the extra time as I now better understand creating instances of classes and am fairly satisfied with the random generation of the lineup (even though that part really only took about 10 minutes).
Comments
Post a Comment