简介

本系列是最佳实践的集合,可帮助您有效地使用Godot。

Godot allows for a great amount of flexibility in how you structure a project’s codebase and break it down into scenes. Each approach has its pros and cons, and they can be hard to weigh until you’ve worked with the engine for long enough.

总是有很多方法可以构造代码并解决特定的编程问题。这里不可能涵盖所有内容。

这就是为什么每篇文章,都是从一个现实世界的问题开始的。我们将每个问题,分解为基本问题,提出解决方案,分析每种选择的利弊,并强调针对当前问题的最佳解决方案。

You should start by reading Applying object-oriented principles in Godot. It explains how Godot’s nodes and scenes relate to classes and objects in other Object-Oriented programming languages. It will help you make sense of the rest of the series.

注解

Godot中的最佳实践,依赖于面向对象的设计原则。我们使用诸如 单一职责 原则和 封装) 之类的工具。