How do I to make enemy just attack player just X distance?

Get help using Construct 2

Post » Tue May 16, 2017 4:03 am

Can anyone help me to make enemy attack player just on X line? :(
B
9
Posts: 20
Reputation: 367

Post » Tue May 16, 2017 4:22 am

Do it like this:
Condition:(Your hit condition)
Subevent: if player.x<enemy.y
SubSubevent: if player.x is >enemy.x-(distance)
Action: (your hit)

For the left side:
Condition: (your hit condition)
Subevent: if player.x>enemy.x
Subsubevent: if player.x<enemy.x+(distance)
Action: your hit

Hopefully i answered your question
Cryttexx

Edit: i understood it wrong. You must change every player.x to enemy.x and every enemy.x to player.x
My Project at this time: robottory-2d-platformer-devlog_t190807



(Sorry for my english. I know it is not the best)
B
16
S
10
G
4
Posts: 112
Reputation: 3,464

Post » Tue May 16, 2017 1:05 pm

NgTrent wrote:Can anyone help me to make enemy attack player just on X line? :(


Hi @NgTrent , you can use many options example( Line of sight, distance, or comparing the player X)

Capx: https://www.dropbox.com/s/eg64fvd0psq5qd8/Two%20Line%20Of%20Sights.capx?dl=0
B
39
S
22
G
77
Posts: 289
Reputation: 42,694


Return to How do I....?

Who is online

Users browsing this forum: ratboy3 and 41 guests