how to make an enemy attack

Get help using Construct 2

Post » Fri Oct 23, 2015 11:45 am

hi! i am working on a beat em' up game...
now how do i make the enemy attack?
i tried to set an animation when the enemy collision with the player,and it messed up with the graphics..
i have a state2 var that set to idle,and in the animation i set the value to attacking...
the movement needs to be a 4 direction.

plz help me! thanks!
B
5
Posts: 48
Reputation: 339

Post » Fri Oct 23, 2015 11:51 am

Very simple example just to explain the basics:

Give the enemy a boolean variable attacking

Player on collision with enemy
Enemy set boolean attacking = true

enemy is attacking
> set animation to attack
else
> set animation to idle
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Fri Oct 23, 2015 12:07 pm

ok thanks i will try it
B
5
Posts: 48
Reputation: 339

Post » Fri Oct 23, 2015 1:39 pm

It didn't worked can you give me an capx example for it?
BTW I have two attacking animation one is strike1 and strike2
I have used the choose function for these two
B
5
Posts: 48
Reputation: 339

Post » Fri Oct 23, 2015 2:37 pm

Could you be more specific?

When you entered the above events..
What happened and what did you expect to happen?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Fri Oct 23, 2015 2:52 pm

What happens is that the enemy runs through the player and does not attack..
The attacking is playing only when the enemy is half way inside the player...
I want a line of sight function that will play the animation of the two types of attacking and also will run in a 4 direction toward the player,the enemy needs to follow the player...
The enemy needs to be mirrored too...
Thanks
B
5
Posts: 48
Reputation: 339

Post » Fri Oct 23, 2015 3:11 pm

You asked for attacking on collision..
You never said the enemy moved towards the player..

Mirroring the enemy should be pretty easy based on if the enemy is moving left or right (which would be based on the position of the player I guess)..

Without an example of what you have done so far, the answers you get are based on what we think you are doing..
I'm not sure what you mean by a line of sight function playing an animation..
Also the four direction part throws me a bit of, what if the player is at a different angle from the 4 directions the enemy is able to move?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Fri Oct 23, 2015 3:30 pm

there's my event sheet
if you can help me fix the event sheet..

Image

Image

Image
B
5
Posts: 48
Reputation: 339

Post » Sat Oct 24, 2015 3:43 am

Plz help!
B
5
Posts: 48
Reputation: 339

Post » Sat Oct 24, 2015 9:00 am

help
B
5
Posts: 48
Reputation: 339

Next

Return to How do I....?

Who is online

Users browsing this forum: Voytek and 27 guests