Enemy AI without using bullet (link me)

Get help using Construct 2

Post » Fri May 31, 2013 8:10 am

I have a 2d platformer game, and I want to make an AI for one of my enemy's that doesn't use th bullet add-on. I want it to follow player, jump when it gets to ledge, and when it can't see player I want it just to wonder back in forth. I was also wondering how you could spawn it, where it would come out of a cave. I want it to only spawn 10. I already came up with the instance variable that starts at 10 and takes away one every time it spawns one. But I do t know how to make a censer that knows when they are all dead. Plus when I set it to spawn it doesn't work. The main focus is the AI though. So please give me a link to one already made, and if there isn't one already made that meets those requirements please tell me how to do it.
B
9
S
1
Posts: 42
Reputation: 622

Post » Fri May 31, 2013 8:25 am

If you use the beginners platform tutorial it goes over how to do this. You put invisible sprites in the world and have the enemies react to them by turning around or jumping, etc... You use the platform behavior and to get them to move you use "Simulate Platform" Left/Right/Jump, etc...
B
49
S
12
G
10
Posts: 1,833
Reputation: 14,583

Post » Fri May 31, 2013 8:31 am

How do you make it follow player?
B
9
S
1
Posts: 42
Reputation: 622

Post » Fri May 31, 2013 4:16 pm

Try this out I learned something like this with ConstructChris.



(Player.x) < than the (enemy.X then simulate platform left)   (usually the bullet behavior is -180)


(Player.x) > than the (enemy.X then simulate platform Right)   ( usually the bullet behavior is -360)



With the bullet this pretty much has great results and you can even have the player jumps left or right when it collides with obstacles in your scene.

Hope this helps you.
B
7
S
1
Posts: 33
Reputation: 623

Post » Fri May 31, 2013 4:17 pm

Use the Compare X with the player when doing this line of code.
B
7
S
1
Posts: 33
Reputation: 623


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, JaredX, MikaelS, nahima, Yahoo [Bot] and 14 guests