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







Crash Course 2: Invaders - Part 4

by Hectate (Updated on 2015-01-31)

Part 4: Creating More Actor Types and Importing a Background

Step 21: Now that we have our new Collision Groups, we need to create our Enemy Ship Actor Type. Use the same steps as you used to create the Ship Actor Type to create the Enemy Ship. Here’s a brief reminder of the steps involved:

  1. Click the Dashboard tab.
  2. Click on Actor Types (this may already be highlighted).
  3. Click the dotted line box to create a new Actor Type.
  4. Name the new Actor Type "Enemy Ship".
  5. Add an animation and Add a frame to import the "Alien_grabber.png" image.
  6. Rename our first animation to "Normal".

Step 23: We’ve created our "Enemy Ship" Actor Type and added an animation. Like we did with the Ship in previous steps, we need to set its Physics settings. Let's change our Enemy Ship to the following settings:

  • What kind of Actor Type? Cannot be pushed
  • Can Rotate? No
  • Affected by Gravity? Disabled by Stencyl (you do not have to change it)

Step 24: Choose its Collision Group by clicking the Properties tab and setting its Group to Enemies, as shown.

Are you missing the Enemies and Bullets groups? You need to go back to Part 3 and create them!

Step 25: Next, we need to create the "Bullet" Actor Type. Follow the same steps as you did to create the Ship and Enemy Ship but name the new Actor Type "Bullet". Note that when importing the graphic for the Animation, set the number of Columns to 3, as shown below.

Bullet Actor Type

Step 26: We want to have slightly different Physics settings for the Bullets.

  • What kind of Actor Type? Normal
  • Can Rotate? No
  • Affected by Gravity? No

Lastly, we set our Bullet Actor Type’s Collision Group (in the Properties tab) to Bullets.

Step 27: With our Actor Types created, we need to import a Background image to use in the Scene we’ll create later. Click the Dashboard and then on Backgrounds.

Step 28: In the dialog that pops up, name the Background image Stars and press the Create button.

Step 29: Click on the "Click here to add a frame" on the left, then on Choose Image, and select the "Space Background.png" image from the assets.

Have you saved recently? Now would be a great time to do so if you haven't!

Now it's time to import our sound assets.

Click here to go to Part 5.

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!


my screen won't match the screen shown above. 1/cc2/image29.png

0 1 year, 1 month ago
On step 23, if on the "Affected by gravity?" tab "Yes" is the option you have, select "Cannot be pushed" make sure you selected "Normal". While normal is selected, on the "Affected by gravity?" tab choose "No". Then change the "What kind of actor type?" tab back to "Cannot be pushed".
1 1 year, 11 months ago
It won't let me import the background from my desktop, even though it worked for the other things before it.
1 2 years, 9 months ago
You need to change the actor type to normal, then change the gravity. After that you can change the actor type to normal. :)
1 2 years, 11 months ago
Step 23: When it told me that gravity was already disabled by Stencyl , it was stuck on "Yes", not "No". I feel like this is going to make the enemies fall towards the player and that would not be good. Anybody got any answers?
0 2 years, 11 months ago
I have same problem as jack wildflower
1 3 years, 1 month ago
When I created the "Enemy Ship" and performed all the correct steps, I noticed that in the steps it had gravity automatically set by Stencyl to "No", but for me it had Stencyl automatically set the gravity to "Yes", is there any way to fix this?
1 3 years, 10 months ago
whenever i add a background of big size like 640x480 it is reduced in the screen to 64x48 please help how to fix it
1 4 years, 3 months ago
@kdebruine, I have no "Repeat Background" options...
0 5 years, 3 months ago
Step 29: You need to turn on the "Repeat Background?" option in the Stars background object so that the background will repeat once it is placed in the Level 1 scene.
5 6 years, 12 months ago

Sign In to Comment