Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

您的第一个 3D 游戏

在这个渐进式教程系列中,你将会使用 Godot 创建你的第一个完整 3D 游戏。在本系列最后,你会完成属于自己的简单项目,类似下面的 GIF 动画。

image0

我们要编写的游戏和 您的第一个 2D 游戏 差不多,但是:你可以跳起来了,并且目标是把敌人踩扁。这样,你既可以复习之前教程中学到的内容,也可以以此为基础编写新的代码和特性。

你将学到:

  • 使用 3D 坐标和跳跃机制。

  • 使用运动学实体移动 3D 角色,检测何时何地发生了碰撞。

  • 使用物理层和节点组,检测特定实体之间的交互。

  • 编写基础的程序玩法,按照固定的时间间隔实例化怪物。

  • 设计移动动画,在运行时改变播放速度。

  • 在 3D 游戏中绘制用户界面。

以及更多。

This tutorial is for beginners who followed the complete getting started series. We'll start slow with detailed instructions and shorten them as we do similar steps. If you're an experienced programmer, you can browse the complete demo's source code here: Squash the Creep source code.

备注

你可以在没有做过 2D 的情况下继续学习这个系列。但是,如果你是游戏开发新手,我们建议你从 2D 开始。3D 游戏代码总是比较复杂,而 2D 系列会给你打下基础,让你更轻松地跟上。

We prepared some game assets so we can jump straight to the code. You can download them here: Squash the Creeps assets.

我们将首先为玩家的移动制作一个基本的原型。然后,添加我们将在屏幕周围随机生成的怪物。之后,我们将实现跳跃和压扁机制,然后用一些漂亮的动画来完善游戏。我们将以分数和重玩屏幕结束。

目录