How saara-u-r/tower-game works
SecureVille is a browser-based cyber-city defense game with a Flask backend for serving the game and shared leaderboard data. The player enters a name and department, then plays a lane-based, multi-wave defense run with threats, defenses, decision events, upgrades and a boss encounter. The frontend loads game configuration from the backend; the backend validates and stores leaderboard submissions in SQLite. The game excerpt is partial, so frontend-to-score API wiring and some gameplay details are not shown.
Main entry points: app.py Config endpoint · login.js Identity gate · game.js Game runtime · index.html Game page
Components 14
Player experience
- Identity gate
static/js/login.js - Game page
templates/index.html
Game systems
- Game runtime
static/js/game.js - Wave combat
static/js/game.js - Decision events
static/js/game.js - Upgrade system
static/js/game.js - City rendering
static/js/game.js
Backend services
- Flask API
app.py - Config endpoint
app.py - Leaderboard store
Game configuration
- Building data
config/buildings.json - Threat data
config/threats.json - Defense data
config/defenses.json
Other components
- Player
Connections 9
- Player → Identity gate: enters identity
static/js/login.js - Identity gate → Game runtime: starts game
static/js/login.js - Game runtime → Config endpoint: fetches config
static/js/game.js - Flask API → Game page: renders page
app.py - Flask API → Config endpoint: serves config
app.py - Config endpoint → Building data: loads data
app.py - Config endpoint → Threat data: loads data
app.py - Config endpoint → Defense data: loads data
app.py - Flask API → Leaderboard store: reads and writes
app.py