How do I add barriers to Ghost shooter example ?

Get help using Construct 2

Post » Tue Feb 03, 2015 11:02 pm

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.
You do not have the required permissions to view the files attached to this post.
B
13
S
3
G
1
Posts: 25
Reputation: 1,176

Post » Tue Feb 03, 2015 11:16 pm

> @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.
B
8
S
3
Posts: 197
Reputation: 1,207

Post » Tue Feb 03, 2015 11:24 pm

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.
B
13
S
3
G
1
Posts: 25
Reputation: 1,176

Post » Tue Feb 03, 2015 11:32 pm

> @thren this is a great example about a platform-behavior-object following the player, but it might help: viewtopic.php?f=147&t=123410
B
8
S
3
Posts: 197
Reputation: 1,207


Return to How do I....?

Who is online

Users browsing this forum: jance0405, tetuan and 9 guests