How marcospeedup/whackamolesvg works
Whack-a-Mole is a browser game: the player starts a timed round, clicks generated SVG moles to score, and can adjust their spawn speed. The runtime is implemented in one JavaScript file and uses page elements identified by IDs; the HTML and CSS are present in the tree, but their contents were not provided. The graph therefore focuses on behavior explicit in the JavaScript excerpt.
Main entry points: script.js Round and controls · index.html Game page
Components 6
Game runtime
- Game page
WhackAMoleSVG/index.html - Round and controls
WhackAMoleSVG/script.js - SVG moles
WhackAMoleSVG/script.js - Score updates
WhackAMoleSVG/script.js - Round timer
WhackAMoleSVG/script.js
Other components
- Player
Connections 9
- Player → Round and controls: starts round
WhackAMoleSVG/script.js - Round and controls → Game page: reads controls
WhackAMoleSVG/script.js - Round and controls → SVG moles: creates periodically
WhackAMoleSVG/script.js - Player → SVG moles: clicks
WhackAMoleSVG/script.js - SVG moles → Score updates: increments score
WhackAMoleSVG/script.js - Score updates → Game page: updates display
WhackAMoleSVG/script.js - Round and controls → Round timer: ends after timeout
WhackAMoleSVG/script.js - Round timer → Game page: alerts game over
WhackAMoleSVG/script.js - Round and controls → Game page: updates time display
WhackAMoleSVG/script.js