241,308

Views

Beginner

Level

35

Comments

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!

35 Comments

paradigmentropy
One small correction to Lawgo's link:
http://static.stencyl.com/pedia2/ch 1/cc2/assets.zip

(There was previously a space in the URL.)

0 5 years, 2 months ago
KloaKed
The zip file isnt on the network anymore... I need it as soon as possible. i really wanna start!!!

0 5 years, 3 months ago
Fitch
Skioski go to the properties tab of your ship, then where it says choose group, right beside the drop down menu there is a button that says edit groups.
0 5 years, 5 months ago
Skioski
There is know game option in the dashboard for me either. Talk about being stuck huh
1 5 years, 5 months ago
patsventure
No game tab in dashboard before the next step? tried everything can anybody help?
0 5 years, 6 months ago
iamcelosia
i can't seem to see the Game tab after saving.

1 5 years, 7 months ago
lawgo
@Richsta: you'll need the .ZIP file that was linked in the last step to find the image files.

1. Download the link: http://static.stencyl.com/pedia2/ch 1/cc2/assets.zip
2. Upzip it
3. You'll find the .PNG image files there
4. Continue with the lesson on step 8 and 9 and choose the ship following: CC2 Game Assets > Ship_Flying

1 5 years, 7 months ago
Ricksta
step:8,9 i click choose image and it comes up with the folders menu IM SOOOO CONFUSED!!!! HELP ME WAT DO I CLICK????

1 5 years, 7 months ago
purewater156
Some Notes:
In Step 7, beware that the name should be an action (like flying, jumping...)
Also, when an Actor type is set, go through Appearance, Physics and Properties first.

0 5 years, 7 months ago
pronger
@superdan7 to get the ship bullets and enemy ship pictures you must either already have them or you can get them from stencyl forge
0 5 years, 7 months ago

Sign In to Comment