As of late 2021, we are in the process of updating Stencylpedia and fixing up outdated & broken content. Thanks for your patience!

458,604

Views

Beginner

Level

14

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!

14 Comments

Jorjteeg
2019-10-07 08:57:29,554 INFO [main] stencyl.sw.Session: Logfile: C:\Users\teagueg\AppData\Roaming\St encyl\stencylworks\logs\2019-10-07_ 08-57-29.log
2019-10-07 08:57:29,563 INFO [main] stencyl.sw.Session: OS Name: Windows 10
2019-10-07 08:57:29,563 INFO [main] stencyl.sw.Session: OS Version: 10.0 (64-bit)
2019-10-07 08:57:29,565 INFO [main] stencyl.sw.Session: Java Version: 1.8.0_60
2019-10-07 08:57:29,566 INFO [main] stencyl.sw.Session: Java Home Environment Variable (JAVA_HOME): not set
2019-10-07 08:57:29,567 INFO [main] stencyl.sw.Session: Stencyl Version: 4.0.1 (b10300)
2019-10-07 08:57:29,577 INFO [main] stencyl.sw.Session: Stencyl Workspace: C:\Users\teagueg\AppData\Roaming\St encyl\
2019-10-07 08:57:29,578 INFO [main] stencyl.sw.Session: User Working Directory: C:\Program Files (x86)\Stencyl
2019-10-07 08:57:29,579 INFO [main] stencyl.sw.Session: User Home Directory: C:\Users\teagueg
2019-10-07 08:57:29,579 INFO [main] stencyl.sw.Session: System Path: C:\ProgramData\Oracle\Java\javapath ;C:\WINDOWS\system32;C:\WINDOWS;C:\ WINDOWS\System32\Wbem;C:\WINDOWS\Sy stem32\WindowsPowerShell\v1.0\;C:\W INDOWS\System32\OpenSSH\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\User s\teagueg\AppData\Local\Microsoft\W indowsApps;;C:\Program Files (x86)\Stencyl\runtimes\jre-win\bin; C:\Program Files (x86)\Stencyl\runtimes\jre-win\bin< br /> 2019-10-07 08:57:29,590 DEBUG [main] stencyl.sw.util.Util: Running command: [C:\Program Files (x86)\Stencyl\plaf\haxe-bin\windows \haxe.exe, -version]
2019-10-07 08:57:29,666 DEBUG [main] stencyl.sw.util.Util: Process 'haxe.exe' exited with code: 0
2019-10-07 08:57:29,667 INFO [main] stencyl.sw.Session: Haxe Version: 3.4.7
2019-10-07 08:57:29,673 DEBUG [main] stencyl.sw.util.FileHelper: Deleting: C:\Users\teagueg\AppData\Local\Temp \stencyl961679938525311054
2019-10-07 08:57:29,679 DEBUG [main] stencyl.sw.loc.LanguagePack: Reading... lang\en\global-phrases.lang
2019-10-07 08:57:29,685 DEBUG [main] stencyl.sw.loc.LanguagePack: Reading... lang\en\global-errors.lang
2019-10-07 08:57:29,688 DEBUG [main] stencyl.sw.loc.LanguagePack: Reading... lang\en\global-menu.lang
2019-10-07 08:57:29,690 DEBUG [main] stencyl.sw.loc.LanguagePack: Reading... lang\en\global-welcome.lang
2019-10-07 08:57:29,693 DEBUG [main] stencyl.sw.loc.LanguagePack: Reading... lang\en\global-dashboard.lang
2019-10-07 08:57:29,697 DEBUG [main] stencyl.sw.loc.LanguagePack: Reading... lang\en\global-publish.lang
2019-10-07 08:57:29,701 DEBUG [main] stencyl.sw.loc.LanguagePack: Reading... lang\en\global-updater.lang
2019-10-07 08:57:29,703 DEBUG [main] stencyl.sw.loc.LanguagePack: Reading... lang\en\global-chat.lang
2019-10-07 08:57:29,705 DEBUG [main] stencyl.sw.loc.LanguagePack: Reading... lang\en\global-misc.lang
2019-10-07 08:57:29,706 DEBUG [main] stencyl.sw.loc.LanguagePack: Reading... lang\en\global-forge.lang
2019-10-07 08:57:29,710 DEBUG [main] stencyl.sw.loc.LanguagePack:

0 5 years, 1 week ago
DraconianRain
There is no stompable behaviour in the current version
2 5 years, 1 month ago
xXJOZKERMITXx
The fitness gram pacer test is a multistage aerobic capacity test that inevitably gets faster as it progresses. The test will get faster when you hear this sound:LMAO.
-1 5 years, 5 months ago
iteseagull
k
0 5 years, 6 months ago
lickmyass
what happens if you jizz on your cumputer
also
i came inside noni

-2 5 years, 10 months ago
568607
aye aye aye
-1 7 years, 1 week ago
PhilMeUpWithYourLove
Stomped is there. This might be a glitch. If not then I have no idea how to help you guys
-1 8 years, 1 month 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.)

3 8 years, 1 month 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 8 years, 1 month ago
Henkkas
I can't find stompable group.
-1 8 years, 3 months ago

Sign In to Comment