Creating a Custom Actor

This page will go over the process of creating a custom actor with Meragon. The actor will be a dummy brick block that can be hit and destroyed.

Creating the Class
ExampleActor.h: The  function is run during Scene initialization (a.k.a. when the level is being loaded)

ExampleActor.cpp: The first line will initialize the actor from  (Model, HitSensors, etc.)

The second line will make the actor alive since they are dead by default. An example of an actor being dead is when you collect a coin, it dies.

Adding the Class to the Actor Factory
Add your actor to the factory like this:

mg/Factory/ActorFactory.cpp:

This allows your actor to be created when the ClassName  is used.

In the level editor, you can place this object by adding it to the CreatorClassNameTable and placing it.

In game, it should look roughly like this: