Sage Vaillancourt
1ccf8765ee
Remove some outdated TODOs and comments
2025-02-17 13:26:51 -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
db1409d94d
selene -> luacheck
...
Greatly simplifies the Makefile.
2025-02-16 15:14:59 -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
bb95ef5a63
Add inning count selection to main menu.
2025-02-15 09:40:07 -05:00
Sage Vaillancourt
8943eef73f
Add simple main menu (disabled for now)
...
String names on Logo assets
Add dbg.drawLine() - to use when defining outfield boundaries.
Allow flipped fielder draws.
2025-02-14 15:42:10 -05:00
Sage Vaillancourt
e710a79d9c
Unified test/setup.lua harness
2025-02-12 23:35:05 -05:00
Sage Vaillancourt
c8f128f277
Add alternate logos.
...
Tweak assets.lua2p to put them in their own table.
2025-02-12 23:10:38 -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
b9d25e18d8
New black away uniforms!
...
Generate sprites from component images during load.
Should make it easy to swap out logos at runtime.
2025-02-11 08:32:51 -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
fbbfc3c2e7
Move fielder-draw iteration and dance to fielding.lua
...
Move PlayerImageBlipper to graphics.lua
2025-02-10 22:36:17 -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
534a16ad67
Fix inning switching.
...
Add onThirdOut() as a baserunning dependency instead of relying on a wrapper function in main
Reset pitchTracker on side-switch
2025-02-10 12:47:24 -05:00
Sage Vaillancourt
fc4e12eddd
Updated bg and player sprites.
...
Player is taller now.
Fixed out handling.
2025-02-10 11:24:53 -05:00
Sage Vaillancourt
90fa692303
Fix linting
...
Use .styluaignore instead of Makefile hacks to ignore generated files.
2025-02-09 14:47:37 -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
575c9e0a18
Explicitly set minimap draw sizes
2025-02-09 12:15:37 -05:00
Sage Vaillancourt
0f83298086
Only draw in-bounds fielders on minimap.
...
Inject animator into Ball, instead of entire gfx
2025-02-09 12:09:31 -05:00
Sage Vaillancourt
89c37eaf3d
Move Fielder type into fielding.lua
2025-02-09 11:50:31 -05:00
Sage Vaillancourt
476e0d54cb
Start extracting ball.lua
...
PseudoAnimator -> SimpleAnimator
2025-02-09 11:49:15 -05:00
Sage Vaillancourt
fed1151179
XYPair -> XyPair, throwBall() -> launchBall()
...
Add Point3d type.
2025-02-09 11:35:19 -05:00
Sage Vaillancourt
d74332f685
Store animators directly on the `ball` object
2025-02-09 11:26:24 -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
aadaa6e0d6
Use : instead of . in self function definitions
2025-02-09 10:31:32 -05:00
Sage Vaillancourt
c56cae6527
batter -> baserunning.batter
2025-02-09 10:12:56 -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
50ddd67730
Start drawing fielders in minimap
2025-02-09 00:04:59 -05:00
Sage Vaillancourt
fedf680626
Small action-queue.lua doc-comment tweaks
2025-02-08 22:08:42 -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
b119310859
Even further fielder logic extraction.
...
Also remove some redundant ball-position mutation.
2025-02-08 20:25:30 -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
d85db79e52
Make main.lua functions `local`, where possible
2025-02-08 13:36:09 -05:00
Sage Vaillancourt
66bd97499a
Try to cluster global state together.
...
Start peeling out fielder functions into a new file.
A bit more constant use.
In Makefile, parse main.lua imports for source files.
2025-02-08 11:52:39 -05:00
Sage Vaillancourt
324673ea98
Add music + sound effects to assets.lua2p
2025-02-08 09:39:56 -05:00
Sage Vaillancourt
8dc999fd72
Add LuaPreprocess for asset-processing.
...
Rename image assets to match var names.
2025-02-08 01:53:26 -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
f07530623f
Delete unused ecs.lua toy
...
Add a quick type assertion to outRunner()
2025-02-07 23:56:39 -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
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 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 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
Sage Vaillancourt
af7f719a2c
Quick Makefile and restructuring
2025-01-25 10:12:28 -05:00