170,972

Views

Beginner

Level

11

Comments

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!

11 Comments

ninjamoves
@kdebruine, I have no "Repeat Background" options...
0 11 months, 3 weeks ago
kdebruine
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 2 years, 8 months ago
kuhneye
This example could be clearer. The writer often leaves out bits if vital information that would not be easy to figure out for a newbie. Its like there are small gaps of information and it's annoying.
1 2 years, 11 months ago
kuhneye
Step 24, there are no groups called enemies or bullets as shown in this example. Shouldn't examples match the tech?
-2 2 years, 11 months ago
duud
@BakerJr92 It's all because you haven't created "Enemies" Group in Settings -> Groups.
0 4 years, 2 months ago
BakerJr92
On Step 24 it says "Choose its Collision Group by clicking the Properties tab and setting its Group to Enemies", but I don't have the choice to click Enemies because it's not there. Only these choices show:

http://imageshack.us/a/img594/5550/ screenshot20130522at926.png

I appreciate the help as soon as possible.

-2 4 years, 2 months ago
mhughson
For bullet, "Actor Type" should be "Normal". If not, you will fire bullets in a later step and they will not move.
3 5 years, 3 months ago
Joe
Clarified the text. When "Cannot be pushed" is selected, "affected by gravity?" becomes disabled, which means it's locked to "no".
4 5 years, 3 months ago
LittleMike
I can confirm what pollywoggles said. You cannot select anything for "Affected by Gravity?" if you have "Cannot be pushed" selected. The option becomes grayed out.
0 5 years, 3 months ago
pollywoggles
In Step 26 it says to select the same physics settings as Ship and Enemy Ship, but the first radio button "determine whether the Actor Type can move or not" (it is "Normal" (Ship) and "Cannot be pushed" (Enemy Ship)). I selected "Normal" for the bullet.
1 5 years, 3 months ago

Sign In to Comment