How do I create 8-directions collision?

Get help using Construct 2

Post » Tue Nov 01, 2016 5:46 pm

I am creating a top down zombie shooter and I am currently programming the zombies, but I ran into a problem. The zombies tend to stack up when chasing the player, giving the imprecation that there are less zombies than there really are. The zombies AI uses a combination of path-finding and 8-directions. I would like the zombies to sort of repel each other (similar to Minecraft http://static.planetminecraft.com/files ... 177659.jpg).
I have tried making the zombies have the Solid behavior but that leads to very glitchy behavior (Like zombies pushing the player thru walls). If anybody can help please respond. Thank You
B
20
S
3
Posts: 53
Reputation: 1,075

Post » Tue Nov 01, 2016 7:27 pm

The most realistic way is using boids algorithm. There is an example for that in forum. Alternatively simple hack would do the trick: how-do-i-set-drag-bounds-for-a-sprite_t122964?&hilit=block&start=10
ImageImage
B
108
S
49
G
23
Posts: 783
Reputation: 22,611

Post » Thu Feb 23, 2017 1:33 am

alextro wrote:The most realistic way is using boids algorithm. There is an example for that in forum. Alternatively simple hack would do the trick: how-do-i-set-drag-bounds-for-a-sprite_t122964?&hilit=block&start=10

I love the example CAPX you showed. It is exactly what I was looking for! Except for one problem. The code you provided does not work with instances of the same object. If you know a way to make this work with instances of the same object, I would be thrilled!

PS I tried using Boids flocking algorithm. But it did not produce the type of behavior that I wanted.

PPS Sorry for the response being so late.
B
20
S
3
Posts: 53
Reputation: 1,075

Post » Thu Feb 23, 2017 2:11 am

ImageImage
B
108
S
49
G
23
Posts: 783
Reputation: 22,611


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 14 guests