Crash Course 2: Invaders - Part 2

by Hectate (Updated on 2015-02-01)

Part 2: Creating Actor Types

Step 3: Now that we have a blank game, it’s time to create our Actor Types. We’re going to start with our spaceship, which the player will control. Click the Actor Type button in the Dashboard menu on the left (under Resources, as shown).

Step 4: Next, click the large box in the workspace on the right (shown below) to create our first Actor Type.

Step 5: We will see the "Create New..." dialog appear (shown below). Name your Actor Type "Ship" as shown. Click the Create button.

Stencyl will create our new Actor Type and then open it for us.

Step 6: Our Actor Type does not yet have any images in it, we need to fix that so it can be seen by players. All images for an Actor Type are gathered in Animations, so we need to import images for these Animations. To do this, we need to first create at least one Animation to hold the images.

Since Stencyl opened the new Actor Type for editing in the Appearance tab, we are already where we need to be. Click the large box with the dotted line in the workspace on the right (shown below).

Stencyl will create a new Animation for us and open it in the workspace.

Step 7: We are now looking at the Animation Editor for the new Animation, which by default will be named "Animation 0".

An Animation typically represents a “state” that an Actor could be in, such as Walking, Running, Jumping, etc. As such, it is ideal for us to rename our Animation so that later we can easily identify what state it represents. We need to erase "Animation 0" from the Name field and type "Flying" into it.

Now that our new Animation has been named properly, let's give it some images. We will click on the "Click here to add a frame" box to open our image importer.

Step 8: The image importer dialog below will pop up for us. First we have to select an image to import; click the Choose Image button.

We should have saved and extracted the example assets earlier somewhere on our computer, so we should navigate to that folder. We want to open the "Ship_flying.png" image for this Animation (if you still need to download the assets, click here to download them).

Ship_flying.png selected

Step 9: Individual "frames" of an Animation image are commonly stored in a single larger image. In this case, Ship_flying.png contains four frames. Of course, Stencyl does not automatically know this, so we need to change some settings so the image is not imported as one single, large frame. Set the value in the “Columns” field to 4. This will split our image evenly into four frames separated by black lines, as shown below. Once ready, click Add and Stencyl will import the image as four frames of our Flying animation.

We are back in the Animation Editor and can see that our Flying animation is now showing an animation preview in the list, with the four individual frames in the workspace to the right.

Flying animation completed

Step 10: Now that we have our single Animation, we need to choose the correct Physics settings for our Ship Actor Type. Click the Physics tab, as shown below.

Step 11: The first page that will appear is the “General” page under Physics. Let's leave the "What kind of Actor Type?" option set to Normal, but set "Can Rotate? and "Affected by Gravity?" both to No.

Step 12: Now we need to set the Collision Group that our Actor Type is a member of. This will allow us to specify what our Ship can collide with and what it can’t. Click the Properties tab (shown below).

Step 13: Set the Group to "Players", as shown. If we want to create more Groups, there is an Edit Groups button on the right. You can read more about creating Groups here. Note the Players Group is built into Stencyl and will appear by default on when we click the dropdown, so we don't need to Edit Groups at this point.

Step 14: We want to save our Ship Actor Type (and the game) by clicking File and then Save Game. Note that there is a keyboard shortcut available for this, as well as the "Save Game" disk icon.

We have our Ship Actor Type set up now, so it's time to move on to determining how our Ship, and the other Actor Types we'll create, can collide with one another.

Click here to go to Part 3.

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!


i cant open the zip file, so i cant get the images
0 3 weeks, 2 days ago
Practical comments , For what it's worth , if your business are requiring to merge are interested in merging of , my husband discovered a service here http://goo.gl/Ms4ebj
-2 1 year, 4 months ago
If your ship is tiny, delete the frames and start over. Select "1x" from the scale dropdown BEFORE you click the "Choose image" button.
24 1 year, 11 months ago
FYI: This article was updated (on the same date as this comment) to be current with Stencyl v3.2 (public release). Please keep this in mind if you are reading comments from prior to this date that are referring to the older version of this document and identify issues or solutions that no longer exist. Thanks.
0 2 years, 4 months ago
how to make several pages in my game?(menu,introduce,coin store...)
-1 2 years, 4 months ago
Hi, I'm following this tutorial, when I get to the point where we upload the ship image and turn it into an animation... After selecting the image and setting the columns it gives me the spinning wheel of death, each time. Mac Air (pretty nice setup), running Stencyl 3.2.0.. If this is the wrong place to comment sorry... It's relative to the article.
0 2 years, 5 months ago

In the newer versions of Stencyl, there's a dropdown list for "Scale" when you import assets. Select "Standard x1" before selecting assets to import. I think this has to do with supporting different device resolutions -- in Android you've got mdpi, hdpi, xhdpi and xxhdpi assets which could be directly related to the x1 x1.5 x2 and x4 Scale options.


0 2 years, 9 months ago
where do we put the foldier

0 2 years, 11 months ago
Kshitij SAhu
there are many resource in which is nothing to configure...please fix this bug
0 3 years, 1 month ago
This is awesome tutorial and I am so excited to finish the task.

But I face a problem when I want to import the ship graphic.
In asset folder the file size is 144X54

But, when I use it in stencyl, the image is 36 X13

here is the print screen from my computer.

I do follow all instructions but the ship is still small :(
I can not continue this learning as I stuck at STEP 9 =(

Friends, please help me.Help! help!

1 3 years, 3 months ago

Sign In to Comment