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 6

by Hectate (Updated on 2015-02-01)

Part 6: Creating a Scene

Step 32: Click Scenes in the Dashboard, then we need to click the dotted line box to create a new Scene.

Step 33: After we hit that button, a dialog (shown) will pop up that lets us set some basic parameters for your Scene. Note you can choose the size of your Scene either using Tiles (which will use the Tile Width and Height, as shown) or in pixels. In this case we’re using Tiles and will use the default values, as shown. Let's give it a name of "Level One", and then as usual, we click Create to get Stencyl to make our new scene for us.

Once we do, Stencyl will open up our new scene in the Scene Designer.

Scene Editor

Step 34: To keep things simple, we’re only going to add the background image we imported earlier rather than add any Tiles. Backgrounds are one of the layer types we can have in our scene. To add one, we need to click the small + icon in the Layers list. In there we select New Background Layer.

Step 35: The "Choose a Background" dialog box will appear for us, and we can click on our Stars background and then click OK.

Step 36: Notice that our new Stars background layer is higher in the list than the default "Layer 0"? This means that if we try to add anything to Layer 0 it will be underneath our Stars background! Clearly this is not ideal, so to prevent this from happening, let's move the Stars background to the bottom of the Layers list. We can do this by clicking the down arrow at the bottom of the Layers list while the Stars background is selected.

Now our intial setup of the scene is done, and the main window of the Scene Designer should look like the image below.

Step 37: We’ve got our Scene, so let’s test it. Press the green Test Scene button and after a few moments we should see our Scene appear in a browser.

If the Scene appears, everything is working, and we can move ahead. If not, we can get help by clicking on the Need Help button and then choosing an option in the dialog that pops up. Let’s keep going

Step 38: Click the Actors tab in the Scene Designer, in the Palette on the right. You should see the three Actor Types you created earlier.

Step 39: Now we want to place individual Actors in the Scene. When placing actors, they are put on the Layer that is currently selected. As a result, we need to remember to click on Layer 0 to select it as the current layer.

To place actors, we use the Pencil tool as shown below; select it now if it is not already active.

With the Ship selected from the Actor Type list, Layer 0 selected (and above the background layer!) and the Pencil tool active, move our cursor over to the bottom-center of the Scene and left-click once. The Ship will appear. We only want one Ship for the player to control.

Note that we want the Ship to be within the scene boundaries, so don't put him in the grey "out of bounds" area! Put him inside the scene like in the image below.

Tip: To place Actors at even intervals, hold down the Shift key, which will align an Actor with the Tile grid. You can make the grid appear by pressing the Show Grid button.

Step 40: Next, select the Enemy Ship so we can place a few in the Scene. We can use the Shift key to space them evenly as shown in the image below.

Tip: If any of your Actors don't appear on screen even though you placed them in the Scene, make sure you check the game window's (the viewport's) settings. Its Width should be 640 and Height should be 480. Click Settings and then Display to change this. If you place an Actor outside the bounds of the viewport, you will not see the Actors you placed in your Scene. Also, note you can make a Scene that is larger than the game's viewport. To allow the player to see and move to other parts of the Scene, you'll need to implement a camera and camera scrolling, but doing that is outside the scope of this Crash Course. You can read more about implementing a camera here.

Step 41: Now we have a basic, complete Scene. Make sure it works via the Test Scene button again. We should see your Ship at the bottom of the Scene and the five Enemy Ships hanging out near the top.

We've got our Actors and Scene set up, so now it's time to start learning how to use Stencyl's Design Mode. To start, we're going to add background music to our Scene.

Click here to go to Part 7.

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!


If your display size is set to 640x480 and you still aren't seeing your actors. Go to the background tab of your scene and make sure that when you clicked the to apply your background to the scene. Make sure you didn't click the in the foregrounds box instead of the in the backgrounds box. (may seem obvious but had me stumped for a while)
0 8 years, 8 months ago
If the ship is missing it's probably because of the resolution you had at default. Change resolution to 640 x 480. To do this go back to Dashboard tab and click on Settings under Game Settings(Bottom Left) then pick your correct resolution.
0 9 years, 2 months ago
I saved the game, I tried what benq11607 said but still have the problem. When I click "show foreground" I can see the background but this actors don't appear. Is there another solution for this?
0 9 years, 3 months ago
Oh yeah Thanks you !!!
0 9 years, 4 months ago
I think I found the solution.

1. Go to "Settings"
2. Check "Screen Size" to 640x480
3. Go to Scene -->Level One --> Properties --> Width:20, Height:15

The reason we couldn't see our Player Ship, and distortion was because we choose "Screen Size" to 640x384

Hope this helps!

1 9 years, 4 months ago
No ship for me, either...
I've started over twice and still can't find the problem...

0 9 years, 4 months ago
Hum same for me. I checked everything but I'm actually stuck.
0 9 years, 5 months ago
I have placed the ship but it does not appear in the test?

0 9 years, 5 months ago
Step 36: Click the Scene button along the top bar, then press the Show Background button in the upper right of the editor, as shown. You’ll see the background image appear in the editor.

The background did not show up for me when I clicked the button until I used the Save Game function. I am guessing this is because it doesn't actually commit the change to save the image as the background until I save it. Not hard to figure out, but you may want to make a note of it.

6 9 years, 6 months ago
The background looks stretched wide but not on the crash course,who the heck did that!?
-1 9 years, 6 months ago

Sign In to Comment