Chapter 5. Actor Types and Instances

So far, we have come quite a long way in terms of assimilating the essential Stencyl workflow and learning how to structure the levels in our games, including the implementation of foregrounds, backgrounds, and tilesets to create ludic spaces. However, it is impossible to implement the actual gameplay elements without first learning how to create and deploy Actors in our levels. In this chapter, we will cover all the fundamentals of working with Actor types and instances. The key points covered here will include:

  • Creating Actor Types
  • Importing Animations
  • Customizing Animations, including frame duration in milliseconds and so on
  • Editing physics settings, such as, but not limited to, mass, linear and angular drag, friction, and bounce
  • Customizing collision shapes
  • Adding Actor instances to our Scenes and customizing them if required

By the end of this chapter, you will have the ability to implement the core gameplay elements into your games through the effective utilization of Actors. This will be further built upon in subsequent chapters, where we will examine the process of building basic and advanced Behaviors from scratch using Stencyl's signature visual programming interface.

What are actors?

In Stencyl, only two resource types can have Behaviors or code attached to them. The relevant Behavior types are as follows:

  • Scene Behaviors: These are attached to Scenes and are usually used to handle more global events, such as timers and score keeping, not specific to one actor
  • Actor Behaviors: These are attached to Actors themselves and are generally used to govern their movement around the level, their physical interaction with other actors or tiles, and in some cases, to make the actor respond to user input

Coupling Actors with Actor Behaviors in an intelligent fashion allows us to create an unlimited variety of game mechanics and gameplay elements. Hence, the creative use of Actors is the key to bringing our game concepts to life within Stencyl.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.22.181.47