# Hit boxes and AI

Get help using Construct 2

### » Thu Sep 26, 2013 4:06 pm

This tutorial is too advanced for me at this point
https://www.scirra.com/tutorials/468/part3-basic-fighting-game-tutorial-video-series

Can anyone explain to me the steps to it?

I made a new "AttackCLSN" object
I made a new image point called "Attack" in "Combo1" frame 2
I made a new action "spawn AttackCLSN object at image point 1 on layer 0" when Combo1 is at frame 2.

Problem:
- when I am inputting the image point, C2 does not accept it when I input "Attack", so I typed 1 instead. It stated there I can input the name or number, so I have no idea why it doesn't accept "Attack"?

then, since my AttackCLSN is just a small square, how can I resize it to fit the size of the attack (like size of whole punching arm for example) since the player in the layout view shows the Idle pose animation.

-----------AI-------------

I have a type of enemy with Idle, walk, punch, hurt

What's a good logic to use for its AI?

and how do I compare the distance between 2 different objects?

B
16
S
7
Posts: 301
Reputation: 2,736

### » Thu Sep 26, 2013 5:32 pm

For AI, look at Pathfinding in the manual. To compare distance you want to use the system expression distance(x1, y1, x2, y2) where 1 is object 1 and 2 is object 2.
B
49
S
20
G
89
Posts: 2,342
Reputation: 52,693

### » Fri Sep 27, 2013 4:05 am

thanks for the help. I used ctrl+F "Path" in the manual to find "Pathfinding" but I can't find it.

I found distance though. that's useful. thanks.

Can anyone help me on hitboxes?

edit:
why does C2 asking me for a string parameter on the y1 (and possibly y2) parameter?

This is what I put in the "For" loop
distance (Luffy.X, Luffy.Y, PirateSwordstand.X, PirateSwordstand.Y)sgn152013-09-27 04:14:50
B
16
S
7
Posts: 301
Reputation: 2,736