Skip to content
/ tetris Public

A modern Tetris game developed using HTML5 Canvas, supporting both desktop and mobile devices.

Notifications You must be signed in to change notification settings

tinhour/tetris

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

俄罗斯方块游戏

一个使用 HTML5 Canvas 开发的现代俄罗斯方块游戏,支持桌面和移动设备。

游戏截图

在线试玩

访问 游戏演示页面 即可开始游戏

功能特点

  • 响应式设计,适配桌面和移动设备
  • 触摸屏支持,移动端专属控制按钮
  • 背景音乐(可控制开关)
  • 分数系统和等级提升
  • 下一个方块预览
  • 游戏暂停功能

操作方式

桌面端

  • ↑: 旋转方块
  • ←: 左移方块
  • →: 右移方块
  • ↓: 加速下落

移动端

  • 旋转按钮: 旋转方块
  • 左箭头按钮: 左移方块
  • 右箭头按钮: 右移方块
  • 下箭头按钮: 加速下落

游戏控制

  • 开始游戏/重新开始按钮
  • 暂停/继续按钮
  • 音乐开关按钮

计分规则

  • 一次性消除的行数越多,获得的分数越高
  • 每 1000 分升一级
  • 等级越高,方块下落速度越快

技术栈

  • HTML5 Canvas
  • CSS3
  • JavaScript (ES6+)
  • Font Awesome 图标库

文件结构

  • index.html: 游戏页面结构
  • styles.css: 样式表文件
  • tetris.js: 游戏逻辑代码
  • game_background.mp3: 背景音乐文件
  • gameplay.png: 游戏截图

浏览器支持

  • Chrome (推荐)
  • Firefox
  • Safari
  • Edge

安装和运行

  1. 克隆仓库到本地
  2. 确保 game_background.mp3 文件位于正确目录
  3. 使用现代浏览器打开 index.html

注意事项

  • 游戏需要现代浏览器支持
  • 音频播放可能需要用户交互才能开始
  • 移动端建议使用竖屏模式游玩

About

A modern Tetris game developed using HTML5 Canvas, supporting both desktop and mobile devices.

Resources

Stars

Watchers

Forks