Skip to content

Basic components

Michele edited this page Oct 26, 2019 · 3 revisions

Preface

Most of the "basic engine usage" Wiki is based on the SimpleGame code, so there will be examples referring to that code.

This page assumes that you have already read "basic engine usage (objects & calls)".

Components

As said before, a Component it's a kind of object that's possessed by a GameObject.

First, you must create a Component calling a method of the ComponentsManager, then, you can add it to a GameObject calling add_component(...). Usually is better if is the GameObject that build and keep the Component pointer, so it can destroy it when no longer needed.

Remember that a Component must be deleted by the ComponentsManager calling the right method. For an example, see how SimpleGame delete the Crates.

List of principal Components