feat: genre starters for asobi init --template#40
Merged
Conversation
Extend `asobi init --template` with local genre starters (arena, chat, turn-based, world) alongside the existing engine demos. A genre scaffolds a runnable lua/match.lua shaped for that style of game - real-time movement + combat, a chat room, server-enforced turn order, or a persistent world - so a first-timer picks a genre and gets working, genre-appropriate server Lua offline and instantly. Templates are embedded files (go:embed) rather than Go string consts, so the Lua stays real and luac-checkable. The default `asobi init` still scaffolds the basic starter; init now leads its next-steps with `asobi dev` to run locally before deploying.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds local genre starters to
asobi init --templatealongside the existing engine demos:--templatearenachatturn-basedworldgame_type = "world", the world-bridge callbacks)basicdefold/godot/unity/backendEach genre scaffolds a runnable
lua/match.luashaped for that style of game, so a first-timer picks a genre and gets working, genre-appropriate server Lua - offline and instantly.How
go:embed) underinternal/scaffold/templates/<genre>/, not Go string consts, so the Lua stays real andluac-checkable.scaffold.Init(dir, genre)walks the genre's embedded tree;Genres()/IsGenre()back the help and error messages.cmdInitroutes a genre name to the local scaffold and an engine name to the remote fetch; an unknown name errors listing both sets.initnext-steps now lead withasobi dev(run locally, no login) before the deploy sequence.Every genre's callback surface is grounded in the real asobi_lua bridges: match modes define
init/join/leave/handle_input/tick/get_state; the world mode usesspawn_position/zone_tick/handle_input(entities)/post_tick. All fivematch.luafiles passluac -p.Tests
go build,go vet,gofmt -l, andgo test ./...all green. New tests cover the default scaffold, overwrite refusal, unknown-genre error, and a table test asserting every genre scaffolds alua/match.luawith its bridge's required callbacks plus a README that runs and deploys.