Crash Course: Let's Make a Game! (Part 3)

by Jon (Updated on 2015-10-17)

Part 1 (Intro) - Part 2 (Resources) - Part 3 (Actors) - Part 4 (Create a Scene) - Part 5 (Test your Game)

Customizing Actors (Part 3 of 5)

We’ve already got some Actor Types in our game, but they aren’t very interesting yet, as without Behaviors, Actor Types can’t do very much.

Creating an “Enemies” Group

Before we jump into customizing our actors, let’s quickly create a Group to categorize our enemies into.

Definition: Groups are used to determine what kinds of Actor Types collide with each other. Groups can also allow you to treat different classes of Actor Types differently. We've got an entire article devoted to Groups and how they affect collisions.

1) Click on the Settings button in the toolbar. The Game Settings window should appear. This is where practically all of your game-wide settings are configured.

Game Settings

2) Switch to the Groups section by clicking the relevant button in the Settings sidebar.

Collision Groups

3) Click the green Create New button around the top of the window.

Create New

4) Type Enemies in the name field and hit Create

Create a New Group...

5) Under Collides With, click on Players and Tiles. The buttons you clicked should turn green. This indicates that Enemies can collide with Players and Tiles.

Collides With

6) Click the OK button in the bottom-right to dismiss the window.


Customizing Noni

To breathe some life into our main character, Noni, and our enemy, Clown, let’s take a more in-depth look at the Actor Type Editor and add the Behaviors included in the Crash Course Kit.

If you haven’t closed the Noni Actor Type yet, click its tab to select it. Otherwise, navigate to the Dashboard and double-click on Noni from the Actor Types section of the Dashboard.

Actor Types

1) The Appearance page of the Actor Editor appears by default. Skip over to the Properties page by clicking its button at the top of the editor.


2) Check to see that Noni is a member of the Players Group. This will ensure that Stencyl will handle the collisions how we intend.

Choose Group

3) Visit the Physics page by clicking the Physics button at the top of the editor.

Physics Button

4) Under General, toggle the Can Rotate? setting to "No". This will ensure that our actor is always oriented with its feet facing the ground, no matter what.

Can Rotate?

5) We’re going to move on to the Behaviors section, where the real crux of the customization takes place. Get there by clicking the Behaviors button (right next to the Appearance button). The following screen will appear:


6) Click on the Add Behavior button in the lower-left hand corner.

7) When the dialog appears, double-click the Walking Behavior.

Choose a Behavior

7) We’re taken back to the Behaviors page of Noni. Notice the addition of the Walking Behavior in the list on the left, as well as all of its configurable Attributes in the main pane.

Definition: Attributes are customizable values that make Behaviors reusable and easy to modify. For more about Attributes, see our introductory article about them.


8) Let’s start customizing these Attributes. Some of the Attributes have default values that we can use, like Speed, whereas others we will have to set ourselves.

First, change Move Right Key and Move Left Key to the right and left Controls respectively.

Control Attributes

Definition: Controls map physical keyboard keys or gamepad buttons to names you can refer to in your behaviors. If you ever decide to change the actual key, you just have to change it once place. See our Controls article for more information.

9) Then choose the desired animations by clicking on the Choose an Animation button and selecting the animation sequences you want.

Animation Attributes

That’s it for the first Behavior!

10) Let’s add the rest and customize them in a similar way. To add more Behaviors, click the Add Behavior button at the lower left-hand corner of the editor.

Add Behavior

Add and configure the following Behaviors:

Here are all the Behaviors you should have added to Noni:

All Behaviors for Noni

Customizing Clown

Clown will be simpler to set up than Noni. Switch over to its tab (or open it from the Dashboard, if need be).

Actor Types

1) Click on the Properties button, as we did with Noni.

2) Go ahead and change Clown’s group to Enemies.

Choose Group: Enemies

3) All that’s left to do with Clown is to add a single Behavior. Click the Behaviors button and add the Stompable Behavior. Customize the following Attributes as such:

Stompable Behavior

Note: As you may be able to tell, this Behavior makes Clown "stompable" like a Goomba in Super Mario Bros. Clown will "die" when hit from above and play a sound when this happens. If you click the Edit Behavior button, you can peek at the "code" behind this Behavior.

Continue to Part 4 →