How to play
Enter your tycoon name and click ENTER WORLD. Pan and zoom the map to any city, then click a spot to buy that territory. Unclaimed land costs $10,000; to take over someone else's spot, pay 50% more than the current value. Your name appears on the map for everyone.
Running Street Tycoon (Cloudflare D1)
This game uses Cloudflare D1 to store territory. To run it locally or deploy:
- Log in:
npx wrangler login - Create the DB:
npx wrangler d1 create street-tycoon-db— copy thedatabase_id. - In the project root, open
wrangler.tomland setdatabase_id = "YOUR_ID"under[[d1_databases]]. - Create the table:
npx wrangler d1 execute street-tycoon-db --command "CREATE TABLE IF NOT EXISTS properties (id TEXT PRIMARY KEY, lat REAL, lng REAL, owner TEXT, price INTEGER, timestamp INTEGER);" --remote - For local dev with D1:
npm run dev(the Cloudflare adapter uses the platform proxy so D1 works locally).
Deploy to Cloudflare Pages; the same repo and wrangler.toml give you the map and API on the edge.