AI (Artificial Intelligence) in Construct 2



Attached Files

The following files have been attached to this tutorial:



Download now 569.65 KB



9,872 visits, 26,447 views


Ok now if we add more layers then people who has free version of Construct 2 will not be able to anything and people who are beginners will not understand. Therefore I am only going to use 4 layers.

What we need now is some other sprites like wall, enemy collision for AI, also for player too.

Insert sprite and name it Solid_Wall. Behaviour to solid

Insert sprite name it Enemy_Collision. Behaviour to solid


For this object add Instance Variable name it Enemy_Action set to Text “JUMP”

Before you open Event Editor add 2 more Event Sheets so you will 3 events sheets. Name it as:

1. Game_Event

2. Enemy_Event

3. Player_Event

At this stage you must place your Solid_Wall, and Enemy_Collision like below or running your project player and enemy will fall down:



You can place this sprite on Walking Path. Now we finish adding all sprites. Time to stat code but before we do that name your first layout Game_Layout and also name event sheet 1 to Game_Event. Open your event editor and let’s add some code. Your event below:

Now go on to Main event and right click, from here click on Include Event Sheet. Add all here also add Global variables too

1. player_isAlive = 1

2. animation_Speed =8

Now open Player_Event and enter this:

Here is complete code for player:

What you see here is it’s in group


  • Order by
Want to leave a comment? Login or Register an account!