Commit Graph

152 Commits

Author SHA1 Message Date
sage 969de111fe Merge pull request 'Properly display balls and strikes' (#3) from proper-balls-and-strikes-display into main
Reviewed-on: #3
Reviewed-by: NikB0t <culvey.nikalas@gmail.com>
2025-02-07 20:11:54 -05:00
Sage Vaillancourt e44bdcb57b magicNumbers = magicNumbers - 1 2025-02-07 14:08:14 -05:00
Sage Vaillancourt 2b436082bb Properly display balls and strikes
But only when the count isn't 0 - 0
2025-02-07 10:34:35 -05:00
sage 9c08990d76 Merge pull request 'Disallow zero-speed bats' (#2) from revert-zero-speed-hits into main
Reviewed-on: #2
2025-02-07 00:53:20 -05:00
Sage Vaillancourt d0f4b9df97 Disallow zero-speed bats 2025-02-07 00:50:49 -05:00
Sage Vaillancourt 9678db167f Hyphen over colon in balls/strikes 2025-02-07 00:47:54 -05:00
sage 16fde510ac Merge pull request 'Skeleton tracking/display of balls and strikes' (#1) from balls-and-strikes into main
Reviewed-on: #1
2025-02-07 00:18:19 -05:00
Sage Vaillancourt a341abed31 Skeleton tracking/display of balls and strikes 2025-02-07 00:17:24 -05:00
Sage Vaillancourt 2867b4a367 Add basic player-controlled fielding.
Pull out a dbg.lua for functions that can be called for testing certain scenarios.
2025-02-06 21:36:51 -05:00
Sage Vaillancourt 4fc49d3631 Add minimap.
Some other small refactors.
2025-02-06 13:34:03 -05:00
Sage Vaillancourt eb28a628f2 buttonControlledThrow() simplification 2025-02-05 23:45:26 -05:00
Sage Vaillancourt 8319b554ec Pitcher can throw to bases.
Logic should be re-usable generally for throwing between fielders.
2025-02-05 23:42:17 -05:00
Sage Vaillancourt 57625a9b80 Player pitching, npc batting, and gloves
Or at least a basic implementation thereof
2025-02-05 18:25:34 -05:00
Sage Vaillancourt 779b13d56b Add basic testing. Requires luaunit.
Put utils functions into a module. Of sorts, anyway.
Add benchAllFielders()
Add playerIsOn() and associated "sides".
Pass appliedSpeed through into runner funcs. Should make it easier to put under NPC control.
2025-02-05 13:52:12 -05:00
Sage Vaillancourt 45a20cbb70 Refactoring and better type hinting. 2025-02-05 10:01:45 -05:00
Sage Vaillancourt 841b7e3fea Decrease BaseHitbox to fix tag-outs
Rename tryToThrowOut() to tryToMakeOut()
2025-02-04 14:27:58 -05:00
Sage Vaillancourt 9df836e0bf Switch to spaces. 2025-02-04 13:06:41 -05:00
Sage Vaillancourt 44ba30ee97 Remove Fielder.onArrive() callback
Instead, just try to throw for an out when touching the ball.
This also tentatively moves toward implementing cutoff throws.
Re-org to define tryToThrowOut() before it is referenced.
2025-02-04 13:04:26 -05:00
Sage Vaillancourt 1d55c27fa2 Allow for more complex pitches.
Add some very mid music.
2025-02-04 11:30:18 -05:00
Sage Vaillancourt fb991e48df Add PlayerBack sprite 2025-02-03 21:27:46 -05:00
Sage Vaillancourt 6308871692 Correct draw offset for hits to right field. 2025-02-03 20:45:18 -05:00
Sage Vaillancourt 6dd8469409 Implement multi-out fielding.
Extract announcer.lua
Fielders now only dance at the end of the half-inning.
Ball is now drawn over everything but the scoreboard and announcer.
2025-02-03 20:26:08 -05:00
Sage Vaillancourt 5d01769eb1 Multiple pitches. Track innings.
Have catcher throw ball back to pitcher.
NOTE: Bit of a timer hack in init() to get the ball to the pitcher at the beginning of the game.
2025-02-03 18:57:45 -05:00
Sage Vaillancourt 14629a5346 Add batting-team indicator to scoreboard. 2025-02-03 12:46:15 -05:00
Sage Vaillancourt e68566957d Fix some fielding logic.
Runner forcedTo fields are now updated properly.
Fielders can throw to bases other than first.
Also, update label() to handle tables.
2025-02-03 00:03:37 -05:00
Sage Vaillancourt a46bac174c Refactor to centralize some secondsSince var usage
Prevent fielder dance as they take the field.
2025-02-02 20:20:53 -05:00
Sage Vaillancourt aa571dab4e Extract runner's onArrive to a dedicated function. 2025-02-02 18:30:35 -05:00
Sage Vaillancourt 5fca82bb3a Queue up announcement messages.
Extract drawScoreboard() to new scoreboard.lua
Very, very rudimentary team-switching.
2025-02-02 17:36:25 -05:00
Sage Vaillancourt 073140f700 Add basic announcement messages.
Switch to checking based on __types.lua instead of __stub.lua
New font for announcement. Move Full Circle font out of subdirectory.
2025-02-02 16:15:29 -05:00
Sage Vaillancourt 66e3d2bb01 Fielders can run the ball towards a base themselves.
Ball can be heldBy a fielder.
Fix likely bug in buildCache() and document it (including contemplating future removal).
Add missing Full Circle font png.
2025-02-02 13:32:22 -05:00
Sage Vaillancourt b9fc7ee09e Tweak drift-toward-base behavior.
It's a little clunky for sure, but also more playable.
Added the Full Circle font for the scoreboard.
Do a *check-only* lint in 'make check'
2025-02-02 11:07:15 -05:00
Sage Vaillancourt bf4fbab40f Quick <const> and case fixes in ecs and utils 2025-02-01 17:47:46 -05:00
Sage Vaillancourt 4546902f2f Backfill with <const>
Use PascalCase for all constants, explain in new README.
Split 'make check' into a separate command (less likely to shift your files out from under you than 'make lint')
Add __stub.ext.lua with quick explainer for why it's useful.
2025-02-01 17:45:10 -05:00
Sage Vaillancourt 32f9b24d1f Add batter walk-up.
Attach bat to batter.
Prevent draw-offset changes when the ball is below the screen.
2025-02-01 16:26:44 -05:00
Sage Vaillancourt f1d8c28370 Add selene to 'make lint'
Patch up its complaints.
Move blipper to graphics.lua
2025-02-01 11:04:27 -05:00
Sage Vaillancourt 4fc37b133e StyLua pass
Add 'lint' recipe to Makefile
2025-02-01 07:39:09 -05:00
Sage Vaillancourt 0b126919ac Better batter-outs, scoreboard, sounds and frowns.
A bunch more refactors, SCREAMING_SNAKE constants, graphics.lua, etc.
2025-01-31 23:34:35 -05:00
Sage Vaillancourt 982b8220a6 Some ECS cleanup with ews() rework. 2025-01-31 18:35:42 -05:00
Sage Vaillancourt ff2b1d0180 Some ECS cleanup with ews() rework. 2025-01-30 12:24:10 -05:00
Sage Vaillancourt 109d67bea9 Unrefined ECS feeling-it-out nonsense. 2025-01-30 11:00:31 -05:00
Sage Vaillancourt 533c625d47 Add .luarc.json for library reading.
Move more stuff to utils.
More type hints.
*Some* fleshing-out of getNextThrowTarget() etc.
Closer to proper multi-baserunner support.
2025-01-30 00:18:02 -05:00
Sage Vaillancourt 4093f9705a Refactoring, typehints, better baserunning 2025-01-29 00:36:55 -05:00
Sage Vaillancourt db52923b32 Extend outfield wall - add outfielders 2025-01-27 00:41:16 -05:00
Sage Vaillancourt 2c179a5ba5 Refactoring.
Consolidate hitBall() and throwBall() into one function.
Pull playerImage into its own "blipper" in utils.lua. This is definitely overkill, but we're learning with Lua, and it's fine, and it's very fine.
2025-01-27 00:26:20 -05:00
Sage Vaillancourt 8bbc029c42 Bigger background for panning across.
Refactor out utils.lua
2025-01-26 23:24:41 -05:00
Sage Vaillancourt 5493f350df Start up some simple baserunning. 2025-01-26 21:34:19 -05:00
Sage Vaillancourt 5fc72c46fe Add simple player image
Start prepping for baserunning
2025-01-26 20:05:24 -05:00
Sage Vaillancourt 42a537dae0 Add simple fielder chasing and throwing mechanics. 2025-01-26 17:24:32 -05:00
Sage Vaillancourt 5df107f767 Remove testing-things-out cruft. 2025-01-26 16:14:55 -05:00
Sage Vaillancourt e81c27f00e Add some images!
Also, patch up hit-detection logic!
Switch from D-Pad controlling hitMult to controlling player position.

This commit keeps a bunch of cruft, in case I messed something up.
The next commit will remove it.
2025-01-26 16:14:27 -05:00