You know I love Sokoban game. You should be able to do a Sokoban in every programming language you know in less than a day, as I told some time ago in this post.
Recently, Construct2 supported Tilemap objects, so it means you can draw your level with a tool like Tiled and import it in your game layout simply dragging and dropping the .tmx file in the layout window.
So, this is how you can add a little interaction and create a tile based game like Sokoban just using the new Tilemap object.
First, you need the tiles, so create the tileset with some drawing software, that’s what I made: from left to right and top to bottom, we have respectively the tiles representing the floor, the wall, the crate target, the crate, the player, the crate on a target, the player on a target and two empty tiles we won’t use in the game.
Once you’re done, save the .tmx file
Now you just have to drag and drop such file into your Construct2 layout, and you’ll have a Tilemap object ready to be used.
Construct also provides an exhaustive set of functions to manage, create, manipolate and destroy tiles, so creating a game once you know the logic (which is explained in my jQuery version), so here it the set of actions to do:
And this is the result:
Control the game with arrow keys
Obviously, you can download the full project