AI 360 movement

Get help using Construct 2

Post » Mon Aug 13, 2012 9:53 pm

Ok guys,

this is probably going to be pretty hard. I have this:

https://dl.dropbox.com/u/97534866/ai.capx

where enemies can move whatever way they want (360). What I have is that if distance between player and enemy is smaller then 400 than enemy starts to move in player's direction.

The problem is that there is wall and enemy goes straight to the wall of course and get stuck there :). I need to make it smarter to beeing able to walk around the wall smoothly. Whats the best way for this?

If I had only 4 way movement (up,down,left,right) then I know how I would probably do that. I could have variable which would store direction of enemy moving. Then from that I would be able to know from what direction enemy hit the wall and I could send it down for example or up whatever. Or I could have home some invisible direction sprites. But I feel in this case there must be something better.

What do you think?Michal112012-08-13 21:55:12
B
8
S
2
Posts: 45
Reputation: 1,168

Post » Tue Aug 14, 2012 4:37 am

I'd do it by way points, placing objects in between the player and the enemy and making him walk to those points 1 by one.
B
36
S
10
G
6
Posts: 948
Reputation: 11,101


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 23 guests