Construct 2 Thoughts/Review

I wanted to talk about a 2D game engine called Construct 2. After a quick Google, you will find that it is an editor that specializes in making 2D games and exports to html5. Upon looking deeper, you might notice that it boasts being able to export to many different platforms including: Android, Windows 8/8.1, Windows Phone, Mac, and quite a few others.

The motivation:

windows 8 challenge

If you are wondering why learn how to use yet another editor, the above image was taken from the Windows 8 Holiday App challenge site hosted by Microsoft. Microsoft is really pushing the use of Construct 2 to make apps and games for 8.1 and the new Windows phones.

The setup:

If you are familiar with programs such as Blender, Unity, Dreamweaver, or the design editors in Visual Studio and Eclipse(or Android Studio), then you should have experienced the ability of dragging and dropping your way into a basic prototype without any coding at all. Just add elements to a blank template and specify some logic bricks to give them meaning. Well this is exactly the same method used by Construct 2 for making 2D games. The example image below is of a blank project:

blank project

Circled are a few important things to note.First is the size specifications to the left. As with any project, you should be weary of setting size specifications as constants because of the very likely chance it will be viewed from different screen sizes. Construct 2 does help by allowing you to specify the procedure for handling smaller or bigger screens without having to create separate layouts. Next, the “layout 1″ and “event sheet 1″ tabs towards the top-middle part of the image is where you start building your apps. Dropping objects into your layout will appear on the screen when the app is run while logic specified in the event sheet will be the guts of the code specifying how to handle objects in your layout (input/output). Below is an image on some of the object types you can drop into your layout:

object types

Above I have circled sprite, which is probably the most common object used. A sprite is basically an object that houses an image. It can house a single image for static pictures (like buttons) or house multiple animations consisting of multiple images (each frame of the animations).

This editor seems pretty geared towards making games; which might make you question that image at the top where Microsoft is pushing Construct 2.Below is a few simple images of the layout and event sheet that show how you can build UI and attach logic that seems more like the end product will be an app than a game:

layout sheet
event sheet

Above you should notice several things going on. In the first image, I placed two “buttons” which are just sprites each with one frame of animation. Making animated buttons might not be so bad either. In the second image is where you can see some logic bricks. It should read like English, even though this is the guts of the program. I wanted to show off the touch input in case you were wondering if construct 2 can handle input that isn’t the keyboard.

So the application above is not much. It is a blank homescreen with two buttons. One of those buttons takes you to another screen that I didn’t show. If you look at the image from the Microsoft website you can see how the end product can look like an app. Their project looks like a language tutor. Below is a screenshot of a game I am working on that will give you an idea of how 2D games are done in Construct 2:

my game screenshot

Above is just a peek at some of the logic behind my player controls. Again, it should be easy to guess what the example is doing because it is done with logic bricks and not code. One thing I did not cover geared more towards games is the behaviors modifications. Basically any object in your layout starts out with no special behaviors. When you add a behavior to an object the engine will automatically create many variables associated with that behavior and store those variables in that object. In the above example my “playerBox” object was attached with a behavior called “platform.” This automatically created variables for him common to most platform games such as x/y velocity, max speed, acceleration, gravty, etc. Below is an image of some of the behaviors you can attach to your objects:

behaviors

You can see above some of the movement types you can give an object. Often the Sprite object discussed earlier is the most common object that is given a wide variety of behaciors. For example giving a text object the “Line of Sight” behavior might prove useless unless you get creative.

Final Thoughts.

Construct 2 is very good for making games. It is also great for making applications that can be thought of as games (take the language tutor example from the first image shown). However Construct 2 exports to html5 and javascript code for all of the platforms I chose to export to (So far tested Android and Windows 8.1). Essentially what it will do is wrap the code in a webview. This poses a lot of constraints I haven’t been able to find answers to yet. For instance how to make a Construct 2 project retrieve permissions and data from the device your exporting to (contact data or data from other applications). Html5 seems to be here to stay and Microsoft has been advocating Construct 2 for months now. At the very least it can be used for the rapid prototyping of UI and game mechanics. I believe Construct 2 is worth a try.