PolyCity v1.0 — full-featured 3D city-builder (Three.js + Vite)

- Procedural island maps, RCI zoning, demand-driven growth
- City-wide power grid with brownouts; wind coastal bonus
- Land value, upgrades, services, pollution, fires & fire spread
- Budget/taxes, happiness, milestones, quest onboarding
- Traffic agents, day/night cycle, adaptive render scale
- Saves: autosave + 3 slots + JSON export/import
- PWA (offline), GitHub Pages/Netlify deploy configs
- Tests: 40-assertion engine suite + headless E2E
This commit is contained in:
PolyCity
2026-08-22 19:17:10 +00:00
commit 56bf3fa2a2
37 changed files with 4996 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
<rect width="64" height="64" fill="#0b1020"/>
<rect x="16" y="34" width="8" height="18" fill="#48d597"/>
<rect x="28" y="26" width="10" height="26" fill="#5aa9ff"/>
<rect x="42" y="38" width="8" height="14" fill="#ffb454"/>
</svg>

After

Width:  |  Height:  |  Size: 300 B

+10
View File
@@ -0,0 +1,10 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
<rect width="64" height="64" rx="12" fill="#0b1020"/>
<rect x="12" y="30" width="10" height="22" fill="#48d597"/>
<rect x="26" y="20" width="12" height="32" fill="#5aa9ff"/>
<rect x="42" y="34" width="10" height="18" fill="#ffb454"/>
<rect x="28" y="24" width="3" height="3" fill="#0b1020"/>
<rect x="33" y="24" width="3" height="3" fill="#0b1020"/>
<rect x="28" y="31" width="3" height="3" fill="#0b1020"/>
<rect x="33" y="31" width="3" height="3" fill="#0b1020"/>
</svg>

After

Width:  |  Height:  |  Size: 550 B

+15
View File
@@ -0,0 +1,15 @@
{
"name": "PolyCity — 3D City Builder",
"short_name": "PolyCity",
"description": "Zone it, power it, grow it. A full 3D city-builder simulation in your browser.",
"start_url": "./",
"scope": "./",
"display": "fullscreen",
"orientation": "any",
"background_color": "#0b1020",
"theme_color": "#0b1020",
"icons": [
{ "src": "./icon.svg", "sizes": "any", "type": "image/svg+xml", "purpose": "any" },
{ "src": "./icon-maskable.svg", "sizes": "any", "type": "image/svg+xml", "purpose": "maskable" }
]
}
+2
View File
@@ -0,0 +1,2 @@
User-agent: *
Allow: /
+38
View File
@@ -0,0 +1,38 @@
/* PolyCity service worker — offline-first app shell */
const CACHE = 'polycity-v1';
const PRECACHE = ['./', './index.html', './manifest.webmanifest', './icon.svg', './icon-maskable.svg'];
self.addEventListener('install', (e) => {
e.waitUntil(
caches.open(CACHE).then((c) => c.addAll(PRECACHE)).then(() => self.skipWaiting())
);
});
self.addEventListener('activate', (e) => {
e.waitUntil(
caches.keys()
.then((keys) => Promise.all(keys.filter((k) => k !== CACHE).map((k) => caches.delete(k))))
.then(() => self.clients.claim())
);
});
self.addEventListener('fetch', (e) => {
const url = new URL(e.request.url);
if (e.request.method !== 'GET' || url.origin !== location.origin) return;
// cache-first for hashed assets, network-first for navigations
if (url.pathname.includes('/assets/')) {
e.respondWith(
caches.match(e.request).then((hit) => hit || fetch(e.request).then((res) => {
const copy = res.clone();
caches.open(CACHE).then((c) => c.put(e.request, copy));
return res;
}))
);
} else if (e.request.mode === 'navigate') {
e.respondWith(
fetch(e.request)
.then((res) => { caches.open(CACHE).then((c) => c.put('./index.html', res.clone())); return res; })
.catch(() => caches.match('./index.html'))
);
}
});