How facundodlf/6thweek---canvas-game works
This repository is a browser-based canvas game. The player uses the keyboard to control a moving character, collect food and bonuses, avoid hazards, and see the score and game state rendered on the canvas. The sampled game.js implements input handling, game rules, timing, and drawing in one runtime module; it also loads the listed audio assets. The HTML entry point and page structure are present in the tree but were not sampled, so their wiring is not shown.
Main entry points: game.js Game logic and rendering · chomp.oga Food sound · dies.oga Death sound · bonus.oga Bonus sound
Components 7
Game runtime
- Game logic and rendering
game.js
Audio assets
- Food sound
assets/chomp.oga - Death sound
assets/dies.oga - Bonus sound
assets/bonus.oga - Game music
assets/monkeysong.oga
Other components
- Player
- Browser canvas
Connections 6
- Player → Game logic and rendering: presses keys
game.js - Game logic and rendering → Browser canvas: draws canvas
game.js - Game logic and rendering → Food sound: loads and plays
game.js - Game logic and rendering → Death sound: loads and plays
game.js - Game logic and rendering → Bonus sound: loads and plays
game.js - Game logic and rendering → Game music: loads and plays
game.js