Beginner's guide to Construct 2

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

Well done for choosing Construct 2! Let's get started making your first HTML5 game. We'll be making the 'Ghost Shooter' demo game. Try it out here first so you know what we're aiming for: a player who looks at the mouse, moves with arrow keys, and shoots monsters with the mouse. You'll learn everything you need to know to make a simple game - from layers to the event system!

Note: please don't ask for help in the comments of this tutorial! Instead, head over to our forum to get the best possible response to any questions you may have.

Alternative tutorials

There is an alternative beginner's guide: How to make a platform game, aimed at making a jump-and-run platformer rather than a top down shooter. You can start with either tutorial, but we highly recommend you complete both to get a good idea how to make both kinds of game!

There's also How to make an Asteroids clone in under 100 events by Kyatric which is a little more advanced but also very detailed.

Installing Construct 2

If you haven't already, grab a copy of the latest release of Construct 2 here. The Construct 2 editor is for Windows only, but the games you make can run anywhere, such as Mac, Linux or iPad. Construct 2 can also be installed on limited user accounts. It's also portable, so you can install to a USB memory stick for example, and take it with you!

Getting started

Now you're set up, launch Construct 2. Click the File button, and select New.
The File menu 'New' button.
In the New Project dialog, you don't need to change anything. Just click Create project. Construct 2 will keep the entire project in a single .capx file for us. You should now be looking at an empty layout - the design view where you create and position objects. Think of a layout like a game level or menu screen. In other tools, this might have been called a room, scene or frame.

Inserting objects

Tiled Background

The first thing we want is a repeating background tile. The Tiled Background object can do this for us. First, here's your background texture - right click it and save it to your computer somewhere:

The Tiled Background texture
Now, double click a space in the layout to insert a new object. (Later, if it's full, you can also right-click and select Insert new object.) Once the Insert new object dialog appears, double click the Tiled Background object to insert it.

The Insert New Object dialog.


A crosshair will appear for you to indicate where to place the object. Click somewhere near the middle of the layout. The texture editor now opens, for you to enter the texture to tile. Let's import the tile image you saved earlier. Click the folder icon to load a texture from disk, find where you downloaded the file to, and select it.

Load texture from file
Close the texture editor by clicking the X in the top right. If you're prompted, make sure you save! Now you should see your tiled background object in the layout. Let's resize it to cover the entire layout. Make sure it's selected, then the Properties Bar on the left should show all the settings for the object, including its size and position. Set its position to 0, 0 (the top left of the layout), and its size to 1280, 1024 (the size of the layout).

Tiled Background properties
Let's survey our work. Hold control and scroll the mouse wheel down to zoom out. Alternatively, click view - zoom out a couple of times. You can also hold space, or the middle mouse button, to pan around. Neat, huh? Your tiled background should cover the entire layout now:

The inserted tiled background.


Hit control+0 or click view - zoom to 100% to return to 1:1 view.

(If you're impatient like me, click the little 'run' icon in the window title bar - a browser should pop up showing your tiled layout! Woo!)

Share and Copy this Tutorial

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

Comments

1
Omarabd55555 3,208 rep

can construct 2 make 3D games yes or no?
if yes how?

Thursday, March 29, 2012 at 7:10:26 PM
1
Markec 733 rep

This is seriously awesome, and it has helped me a lot! Thanks!

Saturday, March 31, 2012 at 1:10:45 PM
1
osiaslemuel 2,438 rep

Great tutorial... =)

Wednesday, April 04, 2012 at 9:15:32 AM
0
blackvikinggames 4,602 rep

I've read this tutorial 10 times. It has helped immensely!

Friday, April 06, 2012 at 1:13:03 AM
0
piec 1,419 rep

Great Tutorial! You help me a lot.

Friday, April 06, 2012 at 5:52:23 PM
0
ctrlyati 429 rep

It's really useful tutorial, thanks.

Monday, April 09, 2012 at 6:57:10 AM
0
Seraphyx 2,114 rep

Not sure if this is an issue but on the last page:

Condition: System -> Every X seconds -> 3
Action: System -> Create object -> Monster, layer 1, 1400 (for X), random(1024) (for Y)

I thought the layout size was 1280 x 1024, so if you set the monster to spawn up to 1400 on X (which is way out of the layout) would that cause any problems if it spawns between 1281-1400?

Is this an error or done intentionally for some reason, setting it to spawn up to 1400.

Thursday, April 12, 2012 at 4:14:43 AM
1
Ashley 112.5k rep

@Seraphyx - because the origin is in the middle of the object, if you spawn it at X = 1280, you'll sometimes see it suddenly appear which looks weird. 1400 is just to make sure it's comfortably off the screen so you see it smoothly move in to the layout area rather than "teleport".

Thursday, April 12, 2012 at 3:17:25 PM
0
Seraphyx 2,114 rep

Comment by Ashley

<span style="background:yellow;font-weight:bold;">@Seraphyx</span> - because the origin is in the middle of the object, if you spawn it at X = 1280, you'll sometimes see it suddenly appear which looks weird. 1400 is just to make sure it's comfortably off the screen so you see it smoothly move in to the layout area rather than "teleport".
Ah thank you, that makes sense then. Great tutorial by the way.

Thursday, April 12, 2012 at 3:47:50 PM
0
lr2bmail 2,572 rep

i am in love with Construct

Thursday, April 12, 2012 at 9:18:14 PM
1
henriesteves 4,835 rep

Awesome tutorial!!! It's helped me a lot.
Thank's and keep doing awesome tutorials =)

Monday, April 16, 2012 at 8:27:47 PM
1
ramones 17.0k rep

Great tutorial. Got me started with Construct and I'm loving it.

Wednesday, April 18, 2012 at 12:02:35 AM
1
carminielloz 8,401 rep

Hi everybody ,
haven t been able to make games in the last few months .... the new version of construct looks a bit different . Would that be the case to update this Tutorial
( which I love by the way !! ) thank you very much !!

Tuesday, April 24, 2012 at 4:24:38 PM
1
Ppp 1,991 rep

hola yo igual tengo un problema mis moustros n opersiguen al objetivo solo lo pasan de largo por el movimiento bala????

Saturday, April 28, 2012 at 3:16:13 AM
2
eryltalbot 3,411 rep

I've finally found the ultimate tool for developing my games. Thanks a lot, Scirra!!!

Wednesday, May 02, 2012 at 6:13:46 PM

Leave a comment

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