Beginner's guide to Construct 2

Favourite 872 favourites
Tutorial written by AshleyOriginally published on 26th, June 2011 - 48 revisions

Adding a layer

Okay, now we want to add some more objects. However, we're going to keep accidentally selecting the tiled background unless we lock it, making it unselectable. Let's use the layering system to do this.

Layouts can consist of multiple layers, which you can use to group objects. Imagine layers like sheets of glass stacked on top of each other, with objects painted on each sheet. It allows you to easily arrange which objects appear on top of others, and layers can be hidden, locked, have parallax effects applied, and more. For example, in this game, we want everything to display above the tiled background, so we can make another layer on top for our other objects.

To manage layers, click the Layers tab, which usually is next to the Project bar:

Layers bar tab
You should see Layer 0 in the list (Construct 2 counts starting from zero, since it works better like that in programming). Click the pencil icon and rename it to Background, since it's our background layer. Now click the green 'add' icon to add a new layer for our other objects. Let's call that one Main. Finally, if you click the little padlock icon next to Background, it will become locked. That means you won't be able to select anything on it. That's quite convenient for our tiled background, which is easy to accidentally select and won't need to be touched again. However, if you need to make changes, you can just click the padlock again to unlock.

The checkboxes also allow you to hide layers in the editor, but we don't need that right now. Your layers bar should now look like this:

The layers bar, all set up.
Now, make sure the 'Main' layer is selected in the layers bar. This is important - the selected layer is the active layer. All new inserted objects are inserted to the active layer, so if it's not selected, we'll be accidentally inserting to the wrong layer. The active layer is shown in the status bar, and also appears in a tooltip when placing a new object - it's worth keeping an eye on.

Add the input objects

Turn your attention back to the layout. Double click to insert another new object. This time, select the Mouse object, since we'll need mouse input. Do the same again for the Keyboard object.

Note: these objects don't need placing in a layout. They are hidden, and automatically work project-wide. Now all layouts in our project can accept mouse and keyboard input.

The game objects

It's time to insert our game objects! Here are your textures - save them all to disk like before.

Player:
Player texture
Monster:
Monster texture
Bullet:
Bullet texture
and Explosion:
Explosion texture
For each of these objects, we will be using a sprite object. It simply displays a texture, which you can move about, rotate and resize. Games are generally composed mostly out of sprite objects. Let's insert each of the above four objects as sprite objects. The process is similar to inserting the Tiled Background:

1. Double click to insert a new object
2. Double click the 'Sprite' object.
3. When the mouse turns to a crosshair, click somewhere in the layout. The tooltip should be 'Main'. (Remember this is the active layout.)
4. The texture editor pops up. Click the open icon, and load one of the four textures.
5. Close the texture editor, saving your changes. You should now see the object in the layout!

Note: another quick way to insert sprite objects is to drag and drop the image file from Windows in to the layout area. Construct 2 will create a Sprite with that texture for you. Be sure to drag each image in one at a time though - if you drag all four in at once, Construct 2 will make a single sprite with four animation frames.

Move the bullet and explosion sprites to somewhere off the edge of the layout - we don't want to see them when the game starts.

These objects will be called Sprite, Sprite2, Sprite3 and Sprite4. That's not very useful - things will quickly get confusing like this. Rename them to Player, Monster, Bullet and Explosion as appropriate. You can do it by selecting the object, then changing the Name property in the properties bar:

Renaming an object.

Share and Copy this Tutorial

You are free to copy, distribute, transmit and adapt this work with correct attribution. Click for more info.

Comments

68
kemosabe 2,797 rep

Nice.i like it

Thursday, June 30, 2011 at 10:42:49 AM
23
ludodesign 25.1k rep
Saturday, July 02, 2011 at 3:26:03 AM
15
ludodesign 25.1k rep

I love you Ashley

Tuesday, July 12, 2011 at 4:00:10 AM
32
luisgmolina 7,564 rep

Very cool.
we need a advanced tutorial now, please.
thank you.

Friday, July 15, 2011 at 7:49:43 PM
21
Skodex 2,544 rep

Thanks for this. You made something which I first thought to be rather complicated, seem extremely easy.

Monday, July 25, 2011 at 6:14:40 PM
13
Dicon 2,659 rep

A great tutorial and not too difficult to get your head around. Are there any books out there for Construct? We all need them.
Thank.
Dicon

Wednesday, July 27, 2011 at 12:08:49 PM
10
driftish 2,468 rep

thanks a whole lot this tutorial was extremely helpful.

Thursday, July 28, 2011 at 8:36:42 AM
11
Mehtab 3,355 rep

awesome tutorial and awesome tool!

Saturday, July 30, 2011 at 10:45:41 AM
8
stufa 2,442 rep

I love it!!!
I've always wanted to create a video game. Your tutorial was clear and interesting. You make a great teacher Mr Ashley.

Oh I tried running your additional tutorial on Ghost Shooter. For some reason I can't run the demo play.

I'm afraid I'm quite a computer noob.

Saturday, August 06, 2011 at 12:14:18 PM
15
ianbrown3003 2,628 rep

This is great! I've just started a games designer course, and although I get a full version of Gamemaker at some point during the course, I wanted to get hands on with using game-making software now...this program looks great, and your beginners guide has eased me in really well, it's well written and very user-friendly. Top work!

You've inspired me to play around more with this program, and that means I'll probably end up buying the full version soon. Good work!

Friday, September 09, 2011 at 9:27:08 PM
11
Ghengis 5,190 rep

This is a must read. Excellent overview of how Construct 2 works.

Tuesday, September 13, 2011 at 4:13:04 AM
17
Ashley 144.6k rep

Just made an update: the tutorial now covers image points (added in r56). It's on page 5.

Saturday, September 17, 2011 at 5:48:10 PM
9
chrisbrobs 6,632 rep

Brilliant tutorial.

Saturday, September 24, 2011 at 11:02:10 PM
8
carminielloz 8,515 rep

oh my Gosh !!! this is amazing , thank you guys !!!!
I only just finished page 1 but I love it
the possibilities to creat a variety of videogames seem endless.
THANK YOU VERY MUCH GUYS !!!

Friday, September 30, 2011 at 6:03:17 AM
5
carminielloz 8,515 rep

my hero moves nicely ( 8 direction , bound to lay out and scroll to )
but i think i missed something , the monster doesn t move , i changed the speed but it never moved in the first place ( i gave him bullet movement but nothing )

Friday, September 30, 2011 at 6:34:29 AM

Leave a comment

Everyone is welcome to leave their thoughts! Register a new account or login.