[Solved] 2D Platformer/Shooter - Shooting Enemy

Get help using Construct 2

Post » Fri Feb 28, 2014 1:24 am

How do I get an enemy in a 2D environment to shoot at my player?

I want to have a shooting enemy in my 2D game.
The issues I'm having is the Turret behavior makes the enemy spin around.
Using the Line-of-Sight behavior is giving my some trouble as well.
Last edited by hypergalaxy on Wed Apr 02, 2014 3:41 pm, edited 1 time in total.
B
8
S
3
Posts: 21
Reputation: 751

Post » Fri Feb 28, 2014 1:59 am

Classic method that seems to work: have the enemy shoot out an invisible "detector" every few seconds so he knows if he can see anything in front of him. If that detector hits anything, it triggers the enemy to run his "shooting" function or group or however you have it set up.

Also check out the distance(x1,y1,x2,y2) thing when determining how far two things are from each other. That can help, too.
B
25
S
6
G
6
Posts: 265
Reputation: 3,696


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 42 guests