This page has been translated automatically.
Видеоуроки
Interface
Essentials
Advanced
Подсказки и советы
Основы
Программирование на C#
Рендеринг
Принципы работы
Свойства (properties)
Компонентная Система
Рендер
Физика
Редактор UnigineEditor
Обзор интерфейса
Работа с ассетами
Настройки и предпочтения
Работа с проектами
Настройка параметров узла
Setting Up Materials
Настройка свойств
Освещение
Landscape Tool
Sandworm
Использование инструментов редактора для конкретных задач
Extending Editor Functionality
Встроенные объекты
Ноды (Nodes)
Объекты (Objects)
Эффекты
Декали
Источники света
Geodetics
World Objects
Звуковые объекты
Объекты поиска пути
Players
Программирование
Основы
Настройка среды разработки
Примеры использования
UnigineScript
C++
C#
Унифицированный язык шейдеров UUSL
File Formats
Rebuilding the Engine Tools
GUI
Двойная точность координат
API
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
Работа с контентом
Оптимизация контента
Материалы
Art Samples
Tutorials
Внимание! Эта версия документация УСТАРЕЛА, поскольку относится к более ранней версии SDK! Пожалуйста, переключитесь на самую актуальную документацию для последней версии SDK.
Внимание! Эта версия документации описывает устаревшую версию SDK, которая больше не поддерживается! Пожалуйста, обновитесь до последней версии SDK.

Quick Start with Component System

What You Will Learn#

Let’s create a small game project to illustrate typical use cases and best practices for the C++ Component System.

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.

You will acquire some basic UnigineEditor skills and knowledge about the UNIGINE engine in general. The basic workflow for game logic implementation with the C++ Component System is given below.

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.

In this tutorial you will learn how to:

  1. Set Up the Project
  2. Create the Controllable Character
  3. Implement Shooting
  4. Generate Physical Objects
  5. Implement Color Zone
  6. Play Background Music
  7. Manage Game Rules
  8. Create the End UI
  9. Build the Project
Notice
The following tutorial is written with float coordinates precision for the Community edition of the SDK. If you wish to follow it using an SDK version with double coordinates precision, you must change data types in the code snippets accordingly (vec3 -> dvec3, and so on).

Additional Reference Materials

For more details refer to the Programming Quick Reference article to learn key information on the workflow stages for developing a project with UNIGINE. It contains code examples that will be useful when developing your first Unigine projects.

Last update: 16.06.2021
Build: ()