English | 简体中文
TinyFarm 是一个使用 Entt, SDL3, OpenGL, MiniAudio, Freetype, glm, ImGui, nlohmann-json 和 Tiled 开发的跨平台 C++ 农场游戏。
本项目是一个教学演示项目,是 “C++ 游戏开发之旅” 系列教程的第 5 篇。
- 移动:
W/A/S/D或方向键↑/←/↓/→ - 攻击/使用:
鼠标左键或K - 交互:
F - 角色灯光切换(夜晚有效):
L - 暂停:
P或Esc - 物品栏:
I - 快捷栏:
Tab - 快捷栏选槽:
1~0(对应 1~10) - 镜头缩放/重置:
鼠标滚轮/中键 - 游戏层调试UI:
F5/` - 引擎层调试UI:
F6/\
依赖项将通过 Git FetchContent 自动下载,构建非常简单:
git clone https://github.com/WispSnow/TinyFarm.git
cd TinyFarm
cmake -S . -B build
cmake --build build注意:本项目使用了付费素材 farm-rpg, 因版权原因,仓库中不提供原始素材文件,只有图片占位符可确保程序正常运行(用于游戏开发学习已足够)。
如果你想要实现演示项目中的效果,可购买该素材后,将所有内容复制到
assets/farm-rpg文件夹中(覆盖原始文件)即可。
如果你在下载此项目时遇到问题(尤其是在中国大陆网络环境下),可从 百度网盘 中下载全部源码(包含第三方库)进行编译。
网盘中的项目源码版本可能落后于GitHub仓库,建议下载本仓库内容,然后拷贝网盘中的第三方库源码(
external文件夹中内容)到本仓库进行编译。
- sprite & UI
- font
- sound
- https://ateliermagicae.itch.io/fantasy-ui-sound-effects
- https://freesound.org/people/Benboncan/sounds/69422
- https://freesound.org/people/michaelperfect/sounds/710298/
- https://freesound.org/people/soundscalpel.com/sounds/110393/
- https://freesound.org/people/Valenspire/sounds/699492/
- https://freesound.org/people/wobesound/sounds/488393
- https://kasse.itch.io/ui-buttons-sound-effects-pack
- https://mixkit.co/free-sound-effects/garden/
- https://mmvpm.itch.io/platformer-sound-fx-pack
- https://pixabay.com/sound-effects/pick-axe-striking-rocks-2-63070/
- https://tommusic.itch.io/free-fantasy-sfx-and-music-bundle
- music
- Sponsors:
sino,李同学,swrainbow,爱发电用户_b7469,玉笔难图,jl
如需支持或反馈,请通过本仓库的 Issues 版块反馈。您的反馈对于改进这一系列教程至关重要!









