321,961

Views

Beginner

Level

8

Comments

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.

OK

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.

Properties

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:

Behaviors

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.

Walking

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:

  • Jumping: Make the following modifications to the default values: Choose action1 for Jump Key. Add the Jump Sound so Stencyl will play a sound effect when Noni jumps. Finally, choose Jump Right and Jump Left for the Jump Right and Jump Left animations, respectively.

    Jumping

  • Stomp on Enemies: Set Stompable Group to Enemies (the group we created at the beginning of this section) and Jump Key to action1.

    Note: You might have to reload the document in order for the Enemies group to show up as an option. Do this by using the keyboard shortcut Ctrl-R (Command-R on Mac), or by navigating to File > Reload Document. Stomp on Enemies

  • Die in Pit and Reload: Nothing to configure here. Just make sure you add it.

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 →


Print Article Edit Article How to Edit an Article
Disclaimer: Use comments to provide feedback and point out issues with the article (typo, wrong info, etc.). If you're seeking help for your game, please ask a question on the forums. Thanks!

8 Comments

PhilMeUpWithYourLove
Stomped is there. This might be a glitch. If not then I have no idea how to help you guys
0 11 months, 1 week ago
stencylsoftware
Should say: Click on "Add Behaviour" in the window "Choose a Behaviour" select the "Stomp On Enemies" group. You will then see "Attributes" ......

Now you can continue with the tutorial.

(I know skipped steps like this are frustrating when you are trying to learn software.)

1 11 months, 2 weeks ago
stencylsoftware
Look whoever is in charge of this training module you lost EVERYONE with this statement under #10 :
----------------------------------- ----------------------------------- ----------------------------------- ------------------
"Stomp on Enemies: Set Stompable Group to Enemies (the group we created at the beginning of this section) and Jump Key to action1.

Note: You might have to reload the document in order for the Enemies group to show up as an option. Do this by using the keyboard shortcut Ctrl-R (Command-R on Mac), or by navigating to File > Reload Document.

We can not understand how to get the "Attributes" action key set sprite Noni. PLEASE CLARIFY WHAT/HOW THIS IS DONE. So we can get on with this project which can't be finished at this point given poor instructions.

Thanks

-1 11 months, 2 weeks ago
Henkkas
I can't find stompable group.
-1 1 year, 1 month ago
spewmash
'Stompable Group' is not available in my case even after Reloading the document
-1 1 year, 3 months ago
akshar2020
my "stompable group" option is not there.
1 1 year, 6 months ago
MikeBedsole
The "Stomped Animation"
0 1 year, 6 months ago
Jon
ANNOUNCEMENT:

We have completely rewritten this Crash Course to make it clearer and followable from start to finish. In order to avoid confusion, we have cleared out the comments for the old crash course.

1 1 year, 10 months ago

Sign In to Comment