Hopkit / Reference
Mechanics you can change
Add source-owned game mechanics and review their updates without losing your changes.
A recipe copies TypeScript into your game. Read it, import it, and change it. Installation does not start a timer or activate behavior.
| You want to | Recipe | Files to edit |
|---|---|---|
| Move, jump, collide with terrain | movement-2d |
src/game/systems/movement/platformer.ts, collision.ts, tile-grid.ts |
| Follow a character | camera-2d |
src/game/systems/camera/follow-camera.ts |
| Flash, shake, emit particles | feedback-2d |
src/game/systems/feedback/feedback.ts |
| Health, inventory, cooldowns, turns | gameplay-state |
src/game/systems/gameplay/ |
| Change the world over a day | day-and-night-system |
src/game/systems/day-night/day-night-clock.ts |
Keep every recipe’s license and integration notes with its source. Advance a
mechanic from your scene’s update callback. It shares the game’s existing loop.
Choose where the rule belongs
Change a setting when the rule stays the same, such as movement speed. Change the
source when the rule changes, such as letting a player jump again in the air.
Do not patch a dependency under .hopkit/vendor/ to change your game’s rules.
The guide’s buffered jump is a small readable example. Its jump buffer remembers a recent press until the character lands. Increasing that duration gives players more forgiveness without changing jump height.
Install and review
The generated project includes a local recipe command. It reads the bundled
snapshot under .hopkit/registry/ and requires no registry server:
node scripts/recipes.mjs add day-and-night-system --apply
node scripts/recipes.mjs diff day-and-night-system
Read the printed file changes before applying an update:
node scripts/recipes.mjs update day-and-night-system --apply
An update can replace unchanged installed source. Modified source produces a conflict instead of silently discarding your changes. Merge the desired upstream changes manually, check the game, and play the affected behavior. Reinstalling the same bundled snapshot does not fetch a newer Hopkit release.
The registry JSON is also compatible with the installed shadcn CLI. Its overwrite prompt is replacement, not a source merge. Inspect its actual targets and integration notes before accepting a replacement.