arthurprs
Great! Let me know if I can assist you.

Over several posts I will talk a little about some of the great features in pyroENGINE. To start off I will speak a little about the Actor System.

In PESDK all objects are derived from a base class called TPEObject. This class implements fundamental functionality that is needed throughout the SDK so that all the different parts work together as a whole. An important feature that this class implement is that it's a node object and can be placed on a double linked list called TPEObjectList. An object can also be assigned attribute values (0-255). This is important because now you can query a group of objects based on these values. An object can be "blue" and be a "powerup" or "red" and can "teleport" for example.

An actor (TPEActor) is the base level object that can exist and have representation in the game world. It has a OnRender, OnUpdate, OnCollide and OnMessage virtual methods that you can override to make your actors behave in a specific way. They live on a derived TPEObjectList class called TPEActorList. You just create an instance of your actor and drop it on a list and during the game loop call the Update and Render methods of the list object and all the actors will come to life. Since an actor can have up to 255 attributes set, if you wish to only render or update certain actors, you just pass this attribute value when you call TPEActorList.Update/Render.

Another object called TPEScene allows you allocate as many lists as you desire to manage a whole scene of actors. For example, you can have your particles on list #0, your player on list #1 and the enemy actors on list #2. When you call TPEScene.CheckCollision you can specify which list to do collision checks on. In this case you would test collisions between the player and an enemy and avoid looping through the many particle objects that would never be part of the collision. This makes collision detection even more efficient. This can be combined with the fast and accurate PolyPoint collision system of the SDK.

In addition to grouping actors by attributes, the object list supports a message system. You can broadcast a message to every actor in the world or expect an actor to respond to your message. An example of using broadcast is where you drop a nuke and it will destroy all objects in the world out to a certain distance. When the nuke spawns, it will send out a message saying "I'm a nuke and if you're are 100 units or less from me you must die." When the actor's gets this message via their OnMessage event handler, then can respond accordingly and destroys themselves.

The TPEEntity object is a high level class that is made from a group of sprite images. It can be positioned, rendered, scaled, rotated and more. It includes such methods as Thrust, RotateToAngle, RotateToPos and many more that can make it really easy to have robust and dynamic objects. For example, the ThrustToPos method can rotate the entity towards a position and it will accelerate towards this position until it reaches a slow down distance at which point it will start to slow down as it comes near. The entity object is derived from TPEAIActor and has a StateMachine that allows you to manage your AI. I will talk more about AI in a future post.