How do I add barriers to Ghost shooter example ?

  • Using the Ghost Shooter example as a basis, Ive tried adding barriers (using sprites with the solid behavior). The player is working fine but the enemy just passes straight through the barrier as if it is not there. Ive tried a few things but Im stumped..

    capx attached.

    Cheers for any assistance.

  • thren: you move the enemy by set position +1 px every tick. Of course it does not stop at the solid walls. You need to add some sort of behavior minding solids, like 8-dir movement. If you use path-finding (which I saw in your file), you need to register obstacles. But i would not recommend doing that, takes too long. Rather do the same (set direction towards player) but then move with 8-direction-movement towards the player. Then the enemy wont pass the walls.

  • thanks muchly !

    the pathfinding was just an attempt to try and solve the issue. I didnt realise I left in in the file.

    I did not consider adding 8 direction movement to the enemy as they moved with the other coding worked a treat.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • thren this is a great example about a platform-behavior-object following the player, but it might help:

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)