I want to show small solution for game developers on Construct 2 / 3, Javascript, HTML 5. 

I use this in my game Bricks Crusher Super Adventures

So, I want to show you example of my solution to prevent objects from overlapping each other. If you need a source, write to me, leave a comment.

 I want to say a few introductory sentences that each solution to the problem must basically be based on the individual situation. 

My solution is not perfect, but it works and solves the overlapping problem. 

Briefly about my task:

  • It is necessary to make an artificial model of behavior for a zombie. 
  • A zombie must have several states: idle, patrol (random), chase. 
  • The following basic behavior libraries are used in the object: Pathfinding, Solid, LineOfSight, Timer, Bullet. 
  • Logic 
    • If the zombie does not see the player, the zombie will randomly patrol the road.
    • If a zombie sees the player, the zombie chases the player. 
    • If a zombie was chasing a player and suddenly the player hides, then the zombie moves to the point where it last saw the player.
    • If a zombie collides with another zombie (collide or overlapping), or an object that dynamically blocks its path (eg a door), the zombie stops for a while and recalculates its further behavior with a new one.


*Among other things, the behavior model can be done without the Pathfinding library. Depends on your task. In this case, you need to understand that the zombie's behavior will also change.

Also available on

Leave a comment

Log in with itch.io to leave a comment.