Asks for a complete single-file HTML5 Canvas snake game with a particle-chain snake, energy crystals to collect and moving firewall barriers.
I want you to act as an expert HTML5 Canvas game developer. Your task is to write a complete, playable SINGLE FILE (index.html) game based on a modernized snake mechanic. GAME SPEC: Title: Cyber Grid Link Core mechanic: Control a snake made of chained vector particles on a shifting grid environment. Goal: Collect glowing energy matrix crystals to grow the link chain while dodging moving firewall barriers. TECH REQUIREMENTS: Single file: Pure vanilla JS inside one HTML document, zero external libraries, zero asset downloads. Rendering: HTML5 2D Canvas with requestAnimationFrame game loop. Smooth LERP interpolation for snake segment movement to create a fluid, organic motion rather than classic blocky steps. Controls: Arrow keys or WASD for absolute directional steering. Design style: Cyberpunk dark theme. The grid must warp slightly near the snake's head using localized coordinate displacement. The snake chain features a pulsing gradient texture.
我需要你扮演一名专业的 HTML5 Canvas 游戏开发者。你的任务是编写一个完整、可玩的单文件(index.html)游戏,基于现代化的贪吃蛇机制。 游戏规格: 标题:Cyber Grid Link 核心机制:在一个不断变化的网格环境中,控制一条由矢量粒子链组成的蛇。 目标:收集发光的能量矩阵水晶,以延长链接链,同时躲避移动的防火墙障碍物。 技术要求: 单文件:纯原生 JS 代码嵌入在一个 HTML 文档中,不使用任何外部库,不下载任何外部资源。 渲染:使用 HTML5 2D Canvas 和 requestAnimationFrame 游戏循环。蛇身各段的移动需采用平滑的 LERP 插值,以实现流畅、有机的运动效果,而非传统贪吃蛇的方块式移动。 控制方式:使用方向键或 WASD 键进行绝对方向操控。 设计风格:赛博朋克暗黑主题。网格在蛇头附近需通过局部坐标位移实现轻微扭曲效果。蛇身链条需具备脉动渐变纹理。