How do I enemy attack in direction

Get help using Construct 2

Post » Sun Nov 22, 2015 12:50 pm

I have a problem with the enemy in my game...
I want it to attack or shot only once in a while when he is facing to the player direction...
And I want it to walk to the player direction,and stop walking when its out of range from the player location.
How do I do that?
Please help!

here is a new download link:

https : / / onedrive.live.com/redir?resid=E432D515DB07E32!1105&authkey=!AFyvxhfupStkPZQ&ithint=file%2ccapx

remember to remove the spaces at the link!

adamu wrote:before you download my capx file I want to say thank you for giving a hand and helping me!
I am grateful for seeing anyone helping me!
Thank you! :D
Last edited by adamu on Wed Nov 25, 2015 7:42 am, edited 9 times in total.
B
5
Posts: 48
Reputation: 339

Post » Sun Nov 22, 2015 3:53 pm

Try using the "Line of sight" Behavior to make the enemy walk towards the player, and stop walking.

For the shooting, just set it to shoot after x seconds, or try using a variable to make it at random.
B
16
S
6
Posts: 259
Reputation: 2,349

Post » Sun Nov 22, 2015 4:03 pm

You can arrange for me to see the .capx file of your project, I can try to help you with it.
B
28
S
9
G
3
Posts: 280
Reputation: 4,162

Post » Sun Nov 22, 2015 4:27 pm

ok i will post the capx file now... wait...
B
5
Posts: 48
Reputation: 339

Post » Sun Nov 22, 2015 4:36 pm

there it is!
https : / / www .dropbox.com / s / atjsny1cm7aius3/ herox.zip?dl=0

the problem is with "enemy2" group...
To download just remove the spaces.
B
5
Posts: 48
Reputation: 339

Post » Sun Nov 22, 2015 9:30 pm

Sorry for the delay in responding is because I am moving this file here, and the file is very large about 40 MB. As far as I programmed, it worked for only one enemigo type goblin2 however the walk is a little strange time to play the animation for more than one enemy type goblin2 these repeat all the actions of another enemy, which is unfortunate, try to figure out why this is happening, what I did seems to work apply to only one enemy of this type in the scene, except that also need to figure out why the walk is this way.
The link:
https://drive.google.com/file/d/0B-bh_etMDYP_cmhVYXk5ZDhmVjQ/view?usp=sharing
B
28
S
9
G
3
Posts: 280
Reputation: 4,162

Post » Mon Nov 23, 2015 3:21 am

thanks! it works fine now!
but one last thing,i need to set a die animation to the enemy...
i fixed an hp bar above the enemy head...
but it needs a die animation that works with that code...
i am uploading the fixed capx file.. hold on..
B
5
Posts: 48
Reputation: 339

Post » Mon Nov 23, 2015 3:26 am

there i uploaded...

https : / / www. dropbox. com / s / 1pbjo7qsoo83ixp / Herox_1.0.3.capx?dl=0

just remove the spaces in the link...
B
5
Posts: 48
Reputation: 339

Post » Mon Nov 23, 2015 8:29 pm

the death animation sprites are already in .capx are those that I saw there?
B
28
S
9
G
3
Posts: 280
Reputation: 4,162

Post » Mon Nov 23, 2015 8:42 pm

Is giving error unknown network, I am not able to download.
B
28
S
9
G
3
Posts: 280
Reputation: 4,162

Next

Return to How do I....?

Who is online

Users browsing this forum: Carlafnt, dokthor, marcoscodas, mtnboy22, MushroomKingdomr and 9 guests