265,890

Views

Beginner

Level

81

Comments

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!

81 Comments

MDuru80
The Background for the scene is too small to fill it up guys. :(
1 12 years, 3 weeks ago
Ddawg
Alright guys I fixed my issues with the actors being so small. Basiclly to make the actors bigger, you click on the scene tab, next to the behaviors tab. where you can see your background and characters of the game. Click on the black arrow on the left hand side on the tab bar, and you will see a resizer box surrounding your ship. Just take the sides you want to enlarge and move your mouse in that direction holding the left hand click button on your mouse. Hope this helped everyone out :) glad I could help
-2 12 years, 3 weeks ago
Ddawg
Did anyone figure out why the actors are coming up mini when I place them in my scene and test them? I am having that problem right now, I had that background problem being small on the upper left hand side of my screen. I just clicked on the background tab, and then clicked on the pencil underneath the background section on the left hand side and then clicked the Repeat background option :) Anyone know how we can enlarge the actors let me know Im going to continue looking :)
1 12 years, 3 weeks ago
DiscoQuinn
I'm running into a unique problem, that doesn't seem to be mentioned in the comments below. My Actors scales are much too small. I noticed this when playing with making my own game from scratch earlier.

http://i.imgur.com/PJfEx4q.png

1 12 years, 1 month ago
pororo007
I stuck at step 37

Got this /:
http://s21.postimg.org/ki5ygiopz/zz zz.jpg

did i miss something like plug in or anything else?how can i fix it??


0 12 years, 2 months ago
jcdsr
follow this step for the background problem

1. select BG on resources
2. create new BG
3. add name to your BG
4. click here to add a frame
5. choose your image
6. before you close or click the add button - make sure the tab on Scale is select to "standard 1x"
7. the BG will preview on big size
8. add to your scene as this tutorial

enjoy

5 12 years, 2 months ago
Carlos Eduardo
Hi fredo, supadav810 and yag2309, i think the solution about the background not stretched is the scale in the "add frame" window. Try Standard (1x) to keep the original size. It works!!!

Hope this helps!

1 12 years, 2 months ago
fredo
Hi guys, i think i found a solution about the background not stretched. I think there is a bug with the background.
i was exactly the same problem with supadav810 and yag2309.

to solve my problem I :
1) select background tab, like the step 34
2) instead click on the " " I clicked on "import.." a the top of the software (close to save game) and add the picture

Hope it will solve your case too.


3 12 years, 2 months ago
supadave810
@yag2309

The image didn't fill the whole scene either for me.

I found that if you go into the Background of your scene and click edit on the image (there's a pencil at the bottom of the window) there is an check mark for "Repeat Background?"

By selecting that it tiles the background. I think the image is just too small.

2 12 years, 2 months ago
yag2309
ive been through this scene process a few times and i cant seem to get the scene background to fit the whole screen when i test the game, it only shows the background on half the screen, yet my ship can move the entire screen left to right. ive checked the scene height and width and is set to as instructed. Have i missed something??

thanks!

2 12 years, 2 months ago

Sign In to Comment