How do I make the enemy fire at me?

Get help using Construct 2

Post » Sun Jul 03, 2016 10:53 pm

i want to make the enemy spawn bullets at me when the players within a certain range of the enemy how do i do this?
B
7
Posts: 52
Reputation: 381

Post » Mon Jul 04, 2016 12:36 am

Hi there,
Without more details about the mechanics of your game (is it a top-down game, platformer or other?), I would suggest you add the LineOfSight behavior to your enemy sprite. Adjust the pixel range in the properties menu and add this event:

If Enemy has LOS to Player =>
(Sub-event) Every X seconds => create bullet; set bullet speed, angle and so forth...

Hope this helps!
B
16
S
9
G
5
Posts: 74
Reputation: 4,120

Post » Mon Jul 04, 2016 8:18 am

[img][img]https://postimg.org/image/noi0unsh3/[/img][/img]

okay so this is my event sheet for a top down shooter. whats wrong here?
B
7
Posts: 52
Reputation: 381

Post » Mon Jul 04, 2016 8:19 am

Image
B
7
Posts: 52
Reputation: 381

Post » Mon Jul 04, 2016 8:20 am

so i managed to make the enemy look at me ect but when it spawns a bullet it just kills itself rather than shoot at my direction
B
7
Posts: 52
Reputation: 381

Post » Mon Jul 04, 2016 8:27 am

Message: OBLIVION can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
https://we.tl/Yl93tHtMco

this is the CAPX file, Perhaps you could modify it for me?
B
7
Posts: 52
Reputation: 381

Post » Mon Jul 04, 2016 9:34 am

Okay so i figured it out however now only one enemy is firing at me? when i kill that enemy another starts shooting at me but i wanted them ALL to shoot at me within range.
B
7
Posts: 52
Reputation: 381

Post » Mon Jul 04, 2016 9:49 am

Why not use the Turret behavior ?
https://www.scirra.com/manual/152/turret

Or, add a system > 'for each' loop to the condition.
B
33
S
18
G
28
Posts: 2,477
Reputation: 20,918

Post » Mon Jul 04, 2016 10:01 am

[quote="99Instances2Go"

Or, add a system > 'for each' loop to the condition.[/quote]

explain further please?
B
7
Posts: 52
Reputation: 381

Post » Mon Jul 04, 2016 10:06 am

how do i edit the turret conditions IE shoot at player with the bullet object ect?

its only let me add the turret behavior
B
7
Posts: 52
Reputation: 381

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 1 guest