Commit Graph

21 Commits

Author SHA1 Message Date
Sage Vaillancourt 08a3189780 Start supporting less accurate pitches
Fix secondsSinceRunnerLastMove nil bug
2025-02-20 00:06:43 -05:00
Sage Vaillancourt 699dab8c7d Fielder.catchEligible -> Ball.catchable
Much simpler
2025-02-19 23:06:22 -05:00
Sage Vaillancourt e20ad0d3ad Add swing-and-a-miss strikes 2025-02-17 20:37:16 -05:00
Sage Vaillancourt 5c45b7bba0 Add box score and transitions
Add constants defining the top of the outfield wall (not used yet)
Take scores out of mutable global state (that might be just about all of it sewn up)
Finish switching batttingTeam to a TeamId value
2025-02-17 13:21:28 -05:00
Sage Vaillancourt bbaaca4a2d Sort runners/fielders by `y` for draw order
Pulled Fielding:drawFielders() back out into main.lua for this.
Also switching some table-keyed enums to string literal types.
2025-02-15 22:13:37 -05:00
Sage Vaillancourt 51855e13cf Convert main into a Game object.
Much BATTER encapsulation of its dependencies and mutable state. Only the team scores are still global and mutable, but that shouldn't be too hard to fix.
2025-02-15 17:38:56 -05:00
Sage Vaillancourt 027bb31bff A bit of testing for baserunning and fielding.
Required minor reworking to get those test harnesses in place.
2025-02-12 22:49:37 -05:00
Sage Vaillancourt a801b64f55 Fielders can catch passing balls.
Implemented with a new catchEligible field. Should be easy enough to add some erroring to those catches, too.
Allow npc to control individual baserunners.
Add a bit more dirt to the infield.

This commit *does* introduce some entanglement between files. E.g. the markIneligible() calls, and overriding ball.heldBy from within Fielding
2025-02-12 17:18:18 -05:00
Sage Vaillancourt 1926960c86 NPCs can play each other
Some timing tweaks and TODOs.
Cluster global state tighter together.
2025-02-11 13:50:03 -05:00
Sage Vaillancourt 0646663e5e Faster fielders
Adjust left and right field positions.
Bouncy baserunners.
Patched npc nil index issue.
2025-02-11 00:01:36 -05:00
Sage Vaillancourt 90f792ff4e More aggressive NPC running
Less aggressive NPC batting :D
Updated Player sprites - now with belt!
2025-02-10 23:25:19 -05:00
Sage Vaillancourt f67d6262ac Fix some NPC positioning.
Basic foul-ball implementation.
Some balance tweaks. Generally faster play.
Move pitchMeter to utils.
Player -> User when talking about the human player instead of a baseball player.
Slightly delay scoreboard changes.
Animate ball-strike entry and exit.
2025-02-10 21:22:21 -05:00
Sage Vaillancourt 4d69e77d9f Class-ify npc -> Npc
In the future, may keep a small memory of past pitches/plays, and use it to adjust swings, baserunning, etc.
2025-02-09 12:30:53 -05:00
Sage Vaillancourt fed1151179 XYPair -> XyPair, throwBall() -> launchBall()
Add Point3d type.
2025-02-09 11:35:19 -05:00
Sage Vaillancourt 9c0d263a29 Class-ify Announcer, Baserunning, and Fielding
Largely to enable dependency injection.
I am pushing AWAY the paranoia that metatable lookups will slow things down. (You've got like 20 entities, bud, chill.)
Field -> Fielding
2025-02-09 11:19:11 -05:00
Sage Vaillancourt 1a68521bd4 Extract baserunning.lua
field.lua -> fielding.lua
npcFielderAction() -> npc.fielderAction()
Generally, a pinch of additional or stricter typing
2025-02-09 10:06:57 -05:00
Sage Vaillancourt 82d1dac5de Buffer player-controlled fielder throws.
Use new actionQueue to do so.
Move thrower and receiver selection into fielder.lua
Correct SOURCE_FILES listing in Makefile
2025-02-08 22:02:29 -05:00
Sage Vaillancourt 30f2eada72 Extract almost all NPC fielding logic 2025-02-08 19:04:10 -05:00
Sage Vaillancourt 80c15161e3 Move more logic into field.lua 2025-02-08 18:28:17 -05:00
Sage Vaillancourt 4a4049996f Much more fleshed-out constants.lua
* Move scoreboard.lua to draw/overlay.lua
* Move minimap drawing into overlay.lua
* Remove playdate imports from utils.lua
2025-02-08 00:49:03 -05:00
Sage Vaillancourt 881ff0e734 Implementing walks and strike-outs
* Look at limiting batting/throw power with math.log()
* Extract draw/fielder.lua
* Extract some values into constants.lua
* Extract npc.lua for computer batting (and eventually probably more CPU behavior)
* pitchTracker in utils
2025-02-07 20:29:40 -05:00