快速开始与组件系统
What You Will Learn你将学习什么#
Let's create a small game project to illustrate typical use cases and best practices for the C++ Component System.让我们创建一个小型游戏项目来说明 C++ 组件系统的典型用例和最佳实践。
The game that you will create is a simple top-down shooter with physics mechanics. The player controls the character with WASD buttons and rotates it to fire bullets using the cursor. The level has some geometric objects (cubes, spheres, etc) that can be thrown to holes by either pushing or shooting. The game has a time limit based on which the game ends. The application also provides a user interface to show the timer and the current amount of objects left to clear. At the end, the game outputs a widget with the reset functionality.你将创建的游戏是一个简单的自上而下射击与物理机制。玩家使用 WASD按钮控制角色,并使用光标旋转它以发射子弹。关卡中有一些几何物体(立方体,球体等),玩家可以通过推或射击将其抛入洞中。游戏有时间限制,这是基于游戏的结束。该应用程序还提供了一个用户界面来显示计时器和当前需要清除的对象数量。最后,游戏输出一个带有重置功能的小部件。
You will acquire some basic UNIGINE Editor skills and knowledge about the UNIGINE engine in general. The basic workflow for game logic implementation with the C++ Component System is given below.您将获得一些关于 UNIGINE 引擎的基本 UnigineEditor 技能和知识。 下面给出了使用 C++ 组件系统实现游戏逻辑的基本工作流程。
C++ Component System enables you to implement your application's logic via a set of building blocks — components, and assign these blocks to objects (nodes), giving them additional functionality. A logic component integrates a node, a C++ class, containing logic implementation (actions to be performed), and a property defining a set of additional parameters to be used.>允许您通过一组构建块(组件)来实现应用程序的逻辑,并将这些块分配给对象(节点),赋予它们额外的功能。逻辑组件集成了一个node,一个C++类,包含逻辑实现(要执行的操作),和一个属性,定义了一组要使用的附加参数。
In this tutorial you will learn how to:在本教程中,您将学习如何:
- Set Up the Project建立项目
- Create the Controllable Character创建可控字符
- Implement Shooting实施射击
- Generate Physical Objects生成物理对象
- Implement Color Zone实现颜色区域
- Play Background Music播放背景音乐
- Manage Game Rules管理游戏规则
- Create the End UI创建结束界面
- Build the Project构建项目
其他参考资料#
有关更多详细信息,请参阅 编程快速参考 文章,了解有关使用 UNIGINE 开发项目的工作流程阶段的关键信息。 它包含在开发您的第一个 Unigine 项目时非常有用的代码示例。