How do I create an AI Tiger

Get help using Construct 2

Post » Tue Feb 03, 2015 12:22 pm

a
Last edited by Adam568 on Wed May 13, 2015 2:45 pm, edited 1 time in total.
B
3
Posts: 4
Reputation: 187

Post » Tue Feb 03, 2015 1:39 pm

There are missing quite a lot as to making the tiger attack, meaning you have no attack event or attack animation in the game :)

So Ill just show you how to get to the point where the tiger stops, and you can create the attack event and animation. There are some things in the game that you don't really need as I see it, but if they serve some other purpose later on you can ofc just leave them.

But I would remove All the behaviours on the tiger, except "BoundToLayout", "Solid" and then just choose one of the movement behaviours. I kept the platform behaviour for this example.

Image

You don't really need Every tick as C2 will do this automatically. Also Putting the "Set Fullscreen scaling to high quality" you should just do in a "Start of layout" no need to do that every tick.

I have removed your movement action and replaced it with the platform simulate control, the speed of the tiger you can just set through this behaviour.

The next event, is when the tiger gets close to the player it will stop, if the player moves away it will "follow".
So you can add the attack animation and whatever else you need when it attacks here. You will need to add some kind of cool down to the attacks and ofc fix the movement, if the tiger is suppose to move in both directions etc.

Anyway hope it will give you an idea of how to continue.
B
44
S
11
G
2
Posts: 1,181
Reputation: 6,826

Post » Fri Feb 06, 2015 9:11 am

Could you do this for me please as i am very confused about how this would work and how to do it and could you then post it please and thank you. ;)
B
3
Posts: 4
Reputation: 187

Post » Fri Feb 06, 2015 10:40 am

Adam568 Do not get me wrong but, you have learn to walk before you can run. We can guide you but we cannot make working capx for you or anyone.
nimos100 has explain your predicament properly learn from it. In no time you be creating game like pro. Best if you cannot understand read C2 famous manual. Good luck
B
239
S
37
G
15
Posts: 1,923
Reputation: 39,758

Post » Fri Feb 06, 2015 1:45 pm

Adam568 wrote:Could you do this for me please as i am very confused about how this would work and how to do it and could you then post it please and thank you. ;)

I could, but wouldn't make much sense, since you need to make the graphics and the whole combat system. As I said in the first post, these things are missing, so there is not really anything to help with in that regard. Also you probably want other types of enemies, so you have to make those work as well.

As Lordshiva suggested, you are better off doing it yourself and try to figure out how to do it. And if you get stuck again you can ask on the forum.
B
44
S
11
G
2
Posts: 1,181
Reputation: 6,826

Post » Fri Feb 06, 2015 2:00 pm

I advice setting some variables to check your X and Y distance first (between player and tiger). Then check using compare X and compare Y if the tiger is at your (player) left or right

Well, I was going to type a long one but I already did here
https://www.scirra.com/tutorials/1320/p ... enemies-ai

Basically use compare X, compare Y and the X and Y distance variables to determine if it will run left, run right, or attack (when near you)

Go have a read at it. It has capx.
B
16
S
7
Posts: 301
Reputation: 2,726


Return to How do I....?

Who is online

Users browsing this forum: AkbarAsgharMG, lwgames and 4 guests