Appearance
Run it locally
Valley Explorers is a Vite + TypeScript app with no framework and no backend. The game, its art and its audio all run in the browser. The source is on GitHub.
Start the game
You need Node.js 20 or newer.
sh
npm install
npm run dev # http://localhost:5173The first run downloads the Pokémon sprites from the PokeAPI sprite collection into public/licensed/pokemon/. They aren't stored in the repository.
| Script | What it does |
|---|---|
npm run dev | Dev server with hot reload |
npm run build | Type-check, then a production build in dist/ |
npm run preview | Serve the production build locally |
Configuration
Copy .env.example to .env.local and fill it in. Everything works without it; you only need it for the $PVE features.
| Variable | Meaning | Default |
|---|---|---|
VITE_SOLANA_CLUSTER | mainnet-beta or devnet | mainnet-beta |
VITE_RPC_URL | Solana RPC endpoint the browser talks to | The public endpoint for the cluster |
VITE_PVE_MINT | The $PVE mint (contract) address | Empty |
While VITE_PVE_MINT is empty, the wallet screen says "$PVE is launching" and the market's Buy buttons are disabled. Everything else plays normally. The public mainnet endpoint rate-limits browsers, so use an RPC provider URL for anything real; it ships in the page, so restrict its allowed origins with your provider.
Where things are
src/
main.ts boot: load art and sprites, show the title screen, start the game
config.ts cluster, RPC, mint, decimals, permit price
data/
creatures.ts every Pokémon: dex no., types, base stats, catch rate, where/when, learnsets, berries
pveShop.ts the $PVE Market catalog, memo receipt format, stone evolutions
game/
game.ts game loop, movement, encounters, lighting, saving
maps.ts the three maps: tiles, props, NPCs, warps, sparkles, garden plots
render.ts ground, edges, y-sorted props, lighting, weather, particles
clock.ts 10-minute days, phases, weather, resting
script.ts NPC dialogue, trainers, garden, foraging, the Grove gate
save.ts save format (localStorage key pve.save.v2)
battle/ battle rules, battle scene, evolution scene
ui/ dialogue, menus, HUD, party, Pokédex, shops, $PVE Market, wallet, touch pad, title
chain/ wallet connection and $PVE transactions (build, simulate, send, verify, history)
art/ original pixel art, drawn in code
audio/ procedural Web Audio music, sound effects and cries
engine/ input (keyboard + touch) and small utilities
public/ logo, banner, icons, web manifest
vite.config.ts build settings and the sprite downloadThe game loads the Solana libraries only when you open a wallet feature, so players who never connect a wallet never download them.
