How toft08/make-game works
Project type and purpose
• This is a single‐page, browser‐based game built entirely with plain JavaScript, DOM APIs, HTML and CSS.
• Purpose: Implement a smooth 60 FPS, Tetris‐style game engine from scratch for learning performance optimization and core JS/DOM rendering.
File structure
• Top‐level assets:
• index.html – the container/page
• style.css – layout & visuals
• images/ – static assets (controls.jpg, favicon.ico)
• Core JS modules (each a separate component):
• game.js – bootstraps the loop and overall game state
• board.js – grid management, collision detection, row clearing
• tetrominos.js – piece definitions & rotation logic
• controls.js – keyboard input handler
• ui.js – DOM updates for score, timer, pause menu
• utils.js – helper functions (e.g., random, timing)
README for insights
• Rendering driven by requestAnimationFrame
• Goal is minimal layout thrashing; efficient DOM updates
• Features: pause menu, scoreboard, keyboard controls