Baseball game dev diary V0.5.3.202012090015 Giving the base buttons meaning

  1. Disabled base buttons at beginning of plate appearance unless occupied.
  2. Remove the code to reset bases in StartGame as that procedure called ResetGame procedure, which called ResetBases anyway. 
  3. Base buttons now display some player info when clicked, by searching for the playerID within the array of objects. 
  4. Added public variable for squadSize instead of hardcoding 28 into several places in code. 
  5. All player statuses set to 3 (benched) at start of game. Changed to 1 when put into game.
  6. 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

Popular posts from this blog

MLB (Road to) The Show attribute progression

MLB The Show 21: create a stadium prediction & using created stadiums in online games

V1.1.4.202103032300 Basic player creator, line score tidy up and additional play results, including errors