How do enemy follow player with AI

Get help using Construct 2

Post » Tue Sep 08, 2015 8:41 am

Hi, I create a test capx for my point,
i have AI for my enemy to move and jump.

but, i want to add some action to my enemy, like follow the player when he see the player.
any help please?

http://
s3.picofile.com/file/8210925700/test_move.capx.html
B
10
S
3
Posts: 180
Reputation: 1,212

Post » Tue Sep 08, 2015 9:11 am

Use the "line of sight" behavior, it detects specific object and then you can use pathfinding or bullet behavior to send your AI to the player's direction (player.x player.Y)
B
7
Posts: 29
Reputation: 331

Post » Tue Sep 08, 2015 9:19 am

I use LOS, but my player and enemy use the platformer behavior.

i don't know how use pathfinding with platformer, i use it already but enemy confused. :)
B
10
S
3
Posts: 180
Reputation: 1,212

Post » Tue Sep 08, 2015 9:20 am

please look at the Capx and edit it, if you may.
B
10
S
3
Posts: 180
Reputation: 1,212

Post » Tue Sep 08, 2015 9:28 am

Hi mosta, am sorry, dt have construct where I am but here is what I think you should do :
Use LOS to get player X and Y. Then make a loop, and simulate control left/right/jump, until the AI hasn't reach or lost the player.
This mean you have to inform the AI where it is it has to jump, maybe use a invisible sprite ou can place where you need the AI to jump, hope this helps
B
7
Posts: 29
Reputation: 331

Post » Tue Sep 08, 2015 10:03 am

@Khelben thank you, i try for it
B
10
S
3
Posts: 180
Reputation: 1,212


Return to How do I....?

Who is online

Users browsing this forum: David181 and 14 guests