Herd bahabiour

Get help using Construct 2

Post » Thu Jan 02, 2014 8:04 pm

Hi, this is my first post

I need to simulate a group of cows being herded by the player. When the player moves close to the cows, all the cow objects move away from the player. Not spreading in every direction, but the cows should follow a leader. The leader is the cows temporarily furthest away from the player. Therefore the leader changes all the time. I know how to identify the leader, but how do I make an object move towards another object of the same type (i.e. the leader) ?

Any suggestion will be much appreciated. Thanks in advance.

AJ
B
2
Posts: 9
Reputation: 176

Post » Thu Jan 02, 2014 8:09 pm

Perhaps tag the furthest away for the duration of the run ?

like, .. pick leader whos furthest away, and pick its UID.

set alll other sheep angles towards sheep with UID.
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,592

Post » Thu Jan 02, 2014 8:17 pm

Try this behavior
http://www.scirra.com/forum/behaviour-boids-flocking_topic61864.html
I used it for one of my games. It works pretty well.
B
10
S
3
G
3
Posts: 234
Reputation: 3,467

Post » Thu Jan 02, 2014 8:35 pm

[[email protected]] Try this behavior
http://www.scirra.com/forum/behaviour-boids-flocking_topic61864.html
I used it for one of my games. It works pretty well.[/QUOTE]

Thanks for posting :D
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,592

Post » Fri Jan 03, 2014 12:53 am


[QUOTE=lennaert] Perhaps tag the furthest away for the duration of the run ?

like, .. pick leader whos furthest away, and pick its UID.

set alll other sheep angles towards sheep with UID.[/QUOTE]

Thanx

How do I "pick its UID"?tpd12014-01-03 00:59:49
B
2
Posts: 9
Reputation: 176


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 21 guests