At a glance
MegaCity Builder starts with a procedurally generated terrain map and gives the player a full mayor toolkit: roads, housing, commerce, industry, utilities, public services, parks, demolish mode, time controls, budget panels, and local saved cities.
Generate terrain
Simplex-style noise creates grass, sand, water, trees, and rocks across a 60 by 60 map.
Lay infrastructure
Roads connect buildings while power plants, wind, solar, water towers, and pumps satisfy city demand.
Grow the city
Residential, commercial, and industrial buildings add population, jobs, income, costs, and pollution.
Manage outcomes
Taxes, happiness, safety, fire, health, education, disasters, and monthly budget ticks shape the city.
Simulation systems
Procedural map
The map module generates terrain, trees, roads, buildings, pollution grids, and service coverage grids for fire, health, education, safety, and happiness.
Canvas renderer
The renderer draws visible tiles only, then layers terrain, water animation, trees, roads, building sprites, placement previews, particles, FPS, coordinates, and a minimap.
Economy loop
Population, tax income, commercial income, maintenance expenses, budgets, monthly history, happiness, and date progression all run through plain JavaScript systems.
City services
Police, fire stations, hospitals, schools, parks, utilities, and civic structures affect coverage, demand, happiness, risk, and building activity.
Player controls
Pan with WASD or arrows, drag the camera, scroll to zoom, place with left click, cancel with right click or Escape, and use speed controls for pause through fast-forward.
Local persistence
Game state serializes the map and economy to localStorage, with auto-save every six in-game months and a welcome-screen load option.
Stack
The project is deliberately lightweight: no framework, no bundler, no backend, just static files and browser APIs. The code is split by system so the canvas renderer, input, map, economy, simulation, audio, and UI can evolve independently.
Status
The shipped build is playable as a static browser game. The current implementation already has the core city loop, HUD, build menu, terrain rendering, simulation ticks, save/load, and time controls. The most natural next steps are deeper balancing, mobile UI tuning, more visual building states, and clearer in-game onboarding.