How villagerjj/openterragb works
OpenTerraGB is a Game Boy Terraria-like game. The main gameplay loop handles player input and world interaction, with world generation and block storage, inventory/crafting, and screen presentation as distinct concerns. The README documents the 512×192 world limit and SRAM-bank use. The sampled main excerpt shows world generation and SRAM-backed block access, but much of the game is concentrated in that file; connections to separate screen, player, and storage modules are left out where the available evidence does not show calls.
Main entry points: main.c Gameplay loop · sram World SRAM banks
Components 16
Game runtime
- Gameplay loop
src/main.c - Player state
src/player.c
World and terrain
- World generation
src/main.c - Block access
src/main.c - World tile data
src/worldtiles.c - World SRAM banks
src/sram
Items and crafting
- Inventory operations
src/inventory.c - Crafting
src/Crafting.c - Item identifiers
src/include/itemIDs.h
Screens and assets
- Title screen
src/Titlescreen.c - Title tile data
src/Titletiles.c - Loading screen
src/loadingscreen.c - Inventory tiles
src/InvTiles.c - Cursor
src/Cursor.c - Number tiles
src/numbers.c
Other components
- Player input
Connections 4
- Player input → Gameplay loop: provides input
src/main.c - Gameplay loop → World generation: generates terrain
src/main.c - World generation → Block access: writes blocks
src/main.c - Block access → World SRAM banks: reads/writes
src/main.c