Cop Out – Construct 2 game making


What lured me to create a game using Construct 2 was the Facebook plug-in. Maintaining a Facebook app is a pain due to the constant API changes. Cop out was a game i had prototyped in the flash Pushbutton engine, i had named it “Keep me in” earlier, you can play that version here. It was a simple game, but i had given up working on it long back. I had some graphics ready for the game, so it looked like i could make this game in HTML5 using Construct 2. Making the game play was a matter of minutes. What took time was integrating the Facebook plug-in, i wish it handled more of the housing keeping and i just had to provide the score.

Uploading the app to heroku though git, worked fine the first time but the next day onwards i kept getting some fatal error with no more info on the windows command prompt. Once i got that resolved i could update new versions of the game with changes. Below are the videos of the making of the game play, you can see how smooth it was, the variables windows wasn’t captured by the video recording software. The cpx file for each part and the full game can be downloaded here.

Cop movement


Thief movement


Scoring and difficulty

Glass moulding – WebGL

Threes.js Mesh Deformation demo using Lathe Geometry

Texture by Humus


Chrome experiment

Glass molding

Glass molding prototype

This demo is inspired by the iPhone Pottery app by iDream. It was a very different app. Pottery in real life is very recreational and the app captured the fun of doing it. The interface too was intuitive. I wanted to try creating something similar as the way they had created it was obvious after seeing the app.

I was checking out Three.js and this is my second demo in Three.js. My first thought was  to use a cylinder or create the geometry myself. After having a look at the built in geometries, the lathe geometry seemed interesting, though it gave some problems at first, but worked out really well. Took me 2 days to make this, the controls are a mess, but that’s the best i could do without adding any buttons, it will need some practice to create something like the one in the image above. Initially i thought of giving it the look of mud, but after i copied some shaders from the three.js demos, it started looking more like glass, hence the name glass molding, also the edges are visibly pointed which resembles more like molten glass.

Air Hockey


Chrome Experiment

800×600 (WebGL)

Full size (WebGL)


This was my first 3D game, if you can call this one, more about this later. I worked on the Air hockey in game in “Master All Classics” on the Nintendo DS which was 2D. It turned out to be something very different from air hockey, the table was somewhat hexagonal due to legal issues and the controls were bad, which was solely my fault. Overall that game sucked.

When Google launched a new 3D plug-in “O3D”, now deprecated, I decided to try out something using it. I first thought of making Pong, but dropped the idea. I had used Box 2D physics engine in the DS game and the physics demo of O3D looked was really cool, so I decided to make a better Air Hockey game and redeem myself. I created a table and some silly art in 3D max. Later a 3D artist friend of mine Roshan created the amazing looking table and background with baked lighting. With these looks I decided to submit it to the Google O3D gallery and they accepted it, but our bad luck they shut down the project before it got hosted. I even made a facebook app, which doesn’t seem to work anymore, thanks to constant facebook api changes.

When WebGL was supported in browsers I decided to try out something. I looked up the new O3D WebGL implementation which I thought would be easier to port the game into, but they it didn’t look that convincing. Three.js looked like the engine of choice for many WebGL demos and the api was very simple too, I went ahead with it and porting the basic game took me 2 days.

Now some technical details, the game is basically 2D and works on the XY plane and uses Box2D physics engine. I think many games can be made using a 2D physics which has lesser impact on performance than a 3D physics engine. The code is in java script, you can download a full screen zipped version here. I haven’t done much work in java script and HTML so the quality of code isn’t really good, and this is not how a complete game should be written. I didn’t use the internal ray casting for moving the user mallet as there was significant drop in performance on the O3D (deprecated) version. It just checks for intersection of the mouse ray with the XY plane on which the table lies. I had some minor issues importing the 3D model from 3D max to Three.js, rest was smooth and I had to let go of the UI, maybe I will add UI in HTML on a later day and complete the game.

Firefox doesn’t allow cross-domain textures and if you want to test demos with textures in firefox on local machine it best to set security.fileuri.strict_origin_policy in about::config to false. Sometimes WebGL doesn’t work on some machine even on firefox 5, setting webgl.force-enabled to true helped.


Pantelis Kalogiros has modified the demo into a full game with menus and customizations for his kinectJS demo, this is truly a awesome work by him. Check it out here:

Air hockey WebGL @ Mobile World Congress 2012 – Barcelona by Webinos, details here


PBEdit – Pushbutton engine editor

Disclaimer: PBEdit is in no way affiliated to Pushbutton Engine. The name PBEdit does not and should not be considered or called Pushbutton Edit, it’s just simply PBEdit.

Github Repository:

Zipped source:


PBEdit is an incomplete Pushbutton engine editor. It was a personal project of mine which I started working on in July 2010 and worked on for about 2 months.

This was my first attempt at making a game editor. I wanted to make one for some time now. Later I got busy with work and abandoned the projects. Recently I thought to make the source code public, it might be useful for someone if not the whole thing at least bits and parts of it could be useful to learn from.

I had made 2 small game prototypes in Pushbutton “Keep Me in” and “Rumble Rolls”. While making any game I always feel the need to have an editor at hand. PBE engine has a really nice way of storing levels in XML. I decided to make a GUI for it, thus the ideas of the editor was born.

The editor has two parts,

  1. Flash part

Which is a Flash Develop project in the. /Editor folder.

2.  The C# part

Which is the Visual studio 2008 solution file is in the root directory

I decided to go with C# because it has really good GUI components and I had previous experience with C# also because it’s possible to communicate between flash and dot net.

The Flash Develop project is just like any Pushbutton engine game and has code for communication with the C# code. It has functions to send and receive data. I recommend reading this to understand how this communication is done using external API

Using the external API with an ActiveX container

I have used the ExternalInterfaceProxy C# project from this example to call functions and receive return values. This project is added to the PBEdit solution.

There are 3 projects in the solution PBEdit is the editor, one is the ExternalInterfaceProxy project mentioned above, the PropertyGridEx project which is the custom property grid control I use to display entity components and properties. You can find more information and example of using this control on This is a wonderful control and was very useful.

The first thing to do after downloading the opening the solution is to set the variable

String swfPath = “D:\\PBEdit\\PBEdit\\Editor\\bin\\Editor.swf”;

in the MainForm.cs constructor to the swf created by the FlashDevelop project, Relative path didn’t seem to work. When you run the project you should see the swf running inside the widow.

The next thing to do is press the “Refresh” button at the top, this fills out the combo boxes and other controls. Clicking on an entity in the swf fills the PropertyGridEx controls with its components and properties. Selecting an entity from the dropdown combo box shows its components and properties in the same way but doesn’t select it in the swf, this is one of the many things missing.

The project uses LINQ which to create Classes during runtime. It’s a very useful feature, and I learnt it from here.

var elements = from element in arrayXML.Elements()//”_”

select new


childType = element.HasAttributes ? element.Attribute(“type”).Value : childType,

def = element,


Where ever you find code similar to this it uses LINQ.

These are some of the high level details of the project and stuff used. You will have to debug the application and learn more about it.  There are a lot of features missing. Hope this was useful.