You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
Jack 319e75447a Initial: playable 3-level Breakout with menus, audio, and power-ups 1 month ago
assets Initial: playable 3-level Breakout with menus, audio, and power-ups 1 month ago
data Initial: playable 3-level Breakout with menus, audio, and power-ups 1 month ago
docs Initial: playable 3-level Breakout with menus, audio, and power-ups 1 month ago
scenes Initial: playable 3-level Breakout with menus, audio, and power-ups 1 month ago
scripts Initial: playable 3-level Breakout with menus, audio, and power-ups 1 month ago
.gitignore Initial: playable 3-level Breakout with menus, audio, and power-ups 1 month ago
CLAUDE.md Initial: playable 3-level Breakout with menus, audio, and power-ups 1 month ago
README.md Initial: playable 3-level Breakout with menus, audio, and power-ups 1 month ago
icon.svg Initial: playable 3-level Breakout with menus, audio, and power-ups 1 month ago
icon.svg.import Initial: playable 3-level Breakout with menus, audio, and power-ups 1 month ago
project.godot Initial: playable 3-level Breakout with menus, audio, and power-ups 1 month ago

README.md

My Bricks

一款用 Godot 4 + GDScript 开发的打砖块(Breakout)小游戏。新手练手项目,实现了从核心玩法到内容扩展的完整闭环。


操作说明

操作 行为
鼠标移动 挡板左右移动
← / → 挡板左右移动(键盘备用)
空格 发球 / 进入下一关 / 重新开始

主菜单用 开始游戏 / 退出 按钮。


玩法

  • 移动挡板反弹小球,击碎场上所有砖块即可过关
  • 3 关,逐关递进(普通砖块 → 笑脸 → 金字塔+不可破坏墙柱)
  • 砖块有 1/2/3 血,颜色绿/黄/红区分
  • 击碎砖块有 15% 概率 掉落道具,掉到底部之前接住生效
  • 球从底部出界扣命,3 命耗尽 → Game Over

已实现道具

颜色 标签 效果
绿 W 挡板变宽 10 秒
L +1 命
M 多球(暂未实现)
S 减速(暂未实现)

技术要点

  • 引擎:Godot 4.x(GL Compatibility 渲染器,桌面/网页通吃)
  • 语言:GDScript
  • 分辨率:1280 × 720
  • 物理层:Layer 1 = World(挡板/墙),Layer 2 = Brick
  • 关卡数据驱动data/level_*.gd 是字符串网格,改关卡不用改代码
  • 信号解耦:砖块不知道分数谁管,只广播"我碎了";Main 收到后加分/判定
  • 音效:用 AudioStreamWAV 程序合成(hit/break/lost/win),无外部素材依赖
  • 道具:Area2D 下落,被挡板接到时发信号

目录结构

my-bricks/
├── scenes/                  # 场景文件
│   ├── main.tscn            # 主场景
│   ├── ball.tscn
│   ├── paddle.tscn
│   ├── brick.tscn
│   ├── lose_zone.tscn
│   ├── power_up.tscn        # 道具
│   └── ui/
│       ├── main_menu.tscn
│       └── hud.tscn
├── scripts/                 # 脚本
│   ├── main.gd              # 状态机 + 信号中心
│   ├── ball.gd              # 反弹 + 提速
│   ├── paddle.gd            # 移动 + 加宽
│   ├── brick.gd             # 血量 + 掉落
│   ├── power_up.gd          # 道具
│   ├── audio.gd             # 程序合成音效
│   ├── level.gd             # 关卡生成器
│   └── ui/
│       ├── main_menu.gd
│       └── hud.gd
├── data/                    # 关卡数据
│   ├── level_1.gd
│   ├── level_2.gd
│   └── level_3.gd
├── docs/                    # 设计文档
│   ├── architecture.md
│   ├── design.md
│   └── milestones.md
└── assets/                  # 预留:图片/音频资源

运行

  1. 安装 Godot 4 稳定版
  2. 在 Godot 里 Import → 选本目录的 project.godot
  3. 编辑器里按 F5

调参

所有参数都在对应脚本的 @export 里,编辑器里直接拖:


进度

docs/milestones.md 走完 M0~M4:

里程碑 内容 状态
M0 环境搭建
M1 核心玩法闭环
M2 手感打磨(反弹角度 / 提速 / 碎砖反馈)
M3 多关卡 + 主菜单 + 音效 + 加宽道具
M4 README + 导出