Cannot get enemy to attack player

Get help using Construct 2

Post » Mon Mar 13, 2017 12:36 am

I have been working on a level and Im trying to get the skeleton enemy to walk toward the player and attack and cause damage I have a link to the capx file. Can someone tell me where I am going wrong and give a screenshot of the event sheet with the correct settings I cant seem to get it to work.
Last edited by Mik07 on Wed Mar 15, 2017 7:29 pm, edited 1 time in total.
B
10
S
3
Posts: 13
Reputation: 676

Post » Mon Mar 13, 2017 1:06 am

I didn't download your CAPX. Too big.

BUT if you want the enemy to stop and attack you need to use a global variable as a stop trigger and a condition to make it stop.

On Enemy Overlapping Player: Set Stop=1, Play Attack animation

Any other events that move the enemy should have the added condition On Stop=0

That way when the enemy overlaps or collides with the player the global variable is triggered and stops any other enemy movement so the attack animation is played.

Once the attack is over reset the global variable to 0 if the enemy was not destroyed.
Banned User
B
23
S
6
G
58
Posts: 1,229
Reputation: 34,540

Post » Mon Mar 13, 2017 2:14 am

Something along these lines is what you're looking for?


Image
B
25
S
16
G
26
Posts: 125
Reputation: 16,103

Post » Wed Mar 15, 2017 7:28 pm

celstrider wrote:Something along these lines is what you're looking for?


Image

Hi Thanks to both of you for the replies to my question about enemy move and attack, celstrider I was trying to use the settings you provided in the screenshot you provided but after I add a System event I dont know what option I need to choose to get the distance (enemy.X.enemy.Yplayer.X.Player.Y) will you tell me which event option I have to choose to enter these values? Im new to construct 2 and I have been stuck with this enemy attack problem for a long time now.
B
10
S
3
Posts: 13
Reputation: 676

Post » Wed Mar 15, 2017 7:58 pm

system - "compare two values"

first value: distance(ect)
<
second value:
B
25
S
16
G
26
Posts: 125
Reputation: 16,103


Return to How do I....?

Who is online

Users browsing this forum: Richterrii and 4 guests