How sam-nisa/gunting-game works
Metal Fury is a browser-based side-scrolling action game. The player starts and controls a run; the game loop advances gameplay and draws the result, while waves, enemies, weapons, and pickups shape combat. The game also provides a shop, persistent player cosmetics and coins, and high scores/leaderboard backed by Firebase when available. The excerpts show key calls across the runtime, but not the HTML script wiring or every shop and persistence implementation detail; those connections are omitted where unverified.
Main entry points: game.js Controls and menus · render.js World simulation · state.js Game state · entities.js Combat and physics
Components 14
Game runtime
- Controls and menus
js/game.js - Game loop
js/game.js - Game state
js/state.js
Combat and progression
- Combat and physics
js/entities.js - Waves and enemies
js/entities.js - World simulation
js/render.js - Shop and rewards
js/game.js - Archived game snapshot
archive/game-full.js
Display and sound
- Canvas rendering
js/render.js - Audio engine
js/audio.js
Player persistence
- High scores
js/game.js - Firebase auth and data
js/firebase-init.js
Other components
- Player
- Player records
Connections 16
- Player → Controls and menus: provides input
js/game.js - Controls and menus → Game loop: starts loop
js/game.js - Game loop → World simulation: calls update
js/game.js - Game loop → Canvas rendering: calls draw
js/game.js - Combat and physics → Game state: uses world state
- Waves and enemies → Game state: uses difficulty
js/entities.js - World simulation → Game state: updates state
- World simulation → Combat and physics: uses combat entities
- Canvas rendering → Game state: draws game state
- World simulation → Shop and rewards: saves rewards
js/render.js - Combat and physics → Audio engine: plays effects
js/entities.js - Controls and menus → Audio engine: starts music
js/game.js - Controls and menus → High scores: records scores
js/game.js - High scores → Firebase auth and data: saves scores
js/game.js - Shop and rewards → Firebase auth and data: persists player data
- Firebase auth and data → Player records: reads and writes
js/firebase-init.js