Skip to main content
Baseball game dev diary: V1.1.2.202101012249 0x-1+1 =1 and 1x-1+1=0
- Added a team class, primarily to make it so that
I could make the buttons on the diamond show up as team colours. ie When team 0 is batting, the base buttons have team 0 colours and the fielding buttons have team 1 colours, and vice versa when the teams switch. Batting
buttons (bases etc) worked first go. Fielding buttons took a little longer as
there was no existing logic to manage them.
- 0*-1+1 is 1 and 1*-1+1 is 0. Basically a
guaranteed way to produce a 0 when a value is a 1 and get a 1 when a value is a
0. Used here to reverse the batting team value to avoid Ifs when working out
the fielding team.
Comments
Post a Comment