Building a Cyberpunk Wealth Simulator Using Pure JS & Web Audio API
Have you ever tried to conceptualize how large $1 Trillion really is? While most tycoon games challenge you to build wealth, I wanted to build something different: a web game where your only goal is to go completely broke.
I created Spend 1 Trillion Dollars—a responsive, single-page browser simulator.
👉 Live Game: https://abhinavgamer730-ops.github.io/Spendtrillions/ 👉 Source Code: https://github.com/abhinavgamer730-ops/Spendtrillions
The Key Mechanics:
Fluctuating Markets: Asset prices (real estate, crypto, luxury items) fluctuate dynamically in real-time. Players must buy high and sell low to dump cash.
Reverse-Casino: A security vault where losing the bet burns your money (bringing you closer to victory), and winning doubles it.
Level Progress: Start at Level 1 ($100B) and unlock harder levels by successfully spending all money.
Behind the Code:
To keep it super fast, the game is built with vanilla HTML5, CSS, and JavaScript.
For the sound effects, I avoided heavy audio downloads. Instead, I used the native browser Web Audio API to synthesize all buttons clicks, alarms, and firework sound effects on the fly using raw oscillators.
I would love to get your feedback on the market pacing and general UI design!
