How lukechern/tetris works
Project type and purpose
• This is a purely client-side, web-based Tetris game (“俄罗斯方块 AI高清重制摸鱼版”), published as an NPM package and optionally as a Discuz! plugin.
• It provides classic Tetris gameplay plus an AI “golden finger” that predicts landing positions. It’s delivered as static HTML/CSS/JS assets with no backend service.
File structure
• Top level
• index_7ree.html – single-page entry point
• package.json – NPM packaging metadata
• demo/ – screenshots for the README
• resource/
• config/ – default (config_system_7ree.js) and user-override (config_user_7ree.js) settings
• css/ – modular CSS files handling layout, themes, animations
• js/ – vanilla-JavaScript modules:
– base_7ree.js (common helpers)
– tetris_7ree.js (core game loop & engine)
– ghost_piece_7ree.js (AI assist / preview)
– celebration_7ree.js, difficulty_7ree.js, etc.
– lang_7ree.js / lang_utils_7ree.js (i18n)
– mo_7ree.js / pc_7ree.js (mobile vs. desktop input handling)
– sound_7ree.js (audio manager)
• sounds/ – background music and SFX assets
README for additional insights
• Core features: classic controls, multiple difficulty levels, AI drop-point prediction, lossless scaling & animations, customizable sound/music and speed, cross-platform via browser.
• Distribution: GitHub repo, NPM module (“aitetris”), optional Discuz! plugin.