Ranged enemies?

Get help using Construct 2

Post » Mon Mar 03, 2014 9:46 pm

I am making a platform game and currently Ive got working melee enemies. And I would like to know how to make when enemy is at X distance of pixels that he stops and starts shooting at me.
B
7
S
2
Posts: 102
Reputation: 975

Post » Mon Mar 03, 2014 10:05 pm

you can use the system compare action to look at the player.x and player.y vs. the enemy.x and enemy.y and if it is less than a certain amount, have the enemy stop and fire.
B
49
S
12
G
10
Posts: 1,833
Reputation: 14,583

Post » Mon Mar 03, 2014 10:09 pm

could you give me a small example pls, judging by what you said it seems like the thing i need
B
7
S
2
Posts: 102
Reputation: 975

Post » Mon Mar 03, 2014 10:17 pm

There is also the distance() function you can use to compare the distance between 2 coordinates
B
20
S
6
G
4
Posts: 347
Reputation: 4,451

Post » Mon Mar 03, 2014 10:21 pm

Where? I tried to find it but is it under conditions or actions, and under system or just some sprite in general?
B
7
S
2
Posts: 102
Reputation: 975

Post » Mon Mar 03, 2014 10:29 pm

I made a small example. Maybe that can help you understand.

https://dl.dropboxusercontent.com/u/2560922/mobiledev/forum/platformerStopAtRange.capx
B
20
S
6
G
4
Posts: 347
Reputation: 4,451

Post » Tue Mar 04, 2014 2:27 pm

Thanks exactly what i needed. Didnt know it was that easy XD
B
7
S
2
Posts: 102
Reputation: 975


Return to How do I....?

Who is online

Users browsing this forum: DiabloOvermind, lukewasthefish, Mayfly, tarek2 and 16 guests