Another older example that I never posted here. Created for a user on the forums it shows how you can use image points rather than detector sprites for detecting sword hits on an enemy. This is useful if you use sword swing animations rather than a sword object in your game. It can of course be used in other situations.
Realised I hadn’t posted this. So here it is. Created for a user on the forums this is an example of 8 direction movement using the left thumbstick on a Gamepad. The user was creating multiple conflicting actions where as this example uses only 4 actions.
Note you’ll have to press a button on the Gamepad for it it start detecting the gamepad input. It’s a browser thing not a Construct bug/problem.
This is an example of how you can use “Bitwise Numbers”, a tilemap and an array in Construct 2 to automatically tile a level for you.
The example is based on my old Construct Classic tutorial which can be found on my old tutorials blog HERE and is based on a wonderful post by Salt on his blog. I recommend giving the blog post a read before opening the .capx as it explains the basics really well.
You can try the HTML5 Demo.
Use left click to place a tile, right click to remove, hold shift & left mouse button and drag to tile a rectangular area.
Here’s an example of loading a level stored as a text file into an array with no external plugins. Created for a user on the forums the example is a bit “hacky” but I created it to show that this sort of thing can be done without the need of external plugins. The example also shows saving the array to JSON and then in layout 2 loading the JSON into a different array.
The level is stored as below in the text file:
Quick note that this example only works with single digits to represent level data.
Sorry for the recent lack of updates & examples.
I’ve shifted my focus slightly and have started work on my first Construct 2 E-Book. The book is going to cover the scary topic of “Arrays”. It’s still in the early stages but I’m getting the basics of the book together and have made a good start of writing one of the step-by-step tutorials.
The book (if completed) is more than likely going to be self published and be either free or dirt cheap (£2-5) considering the amount of content I hope to include.
A quick example for a forum user of how you can use 1 sprite to display the number of lives the player has left. Example uses a simple “For” loop and a Function. Please note that there is no upper/lower bound for the number of lives in the example.
A quick example for someone on the forums of how you can check if an object with “drag & drop” behaviour is dropped onto the correct object/position. There a 2 ways of doing this in the example:
- Checks if the 2 objects “animation frames” are equal to each other – (toggled disabled)
- Checks if the 2 objects “local variables” are equal to each other
The example also displays text to show if you did or didn’t place the object in the correct place.