A few issues on attack animation and enemy behaviour

Get help using Construct 2

Post » Sun Apr 06, 2014 7:57 am

Hi guys,

Been reading the forums and looking for answers but to no solution to my problems.

I'm trying to create a platform fighting game and i have a few issues at hand

1) I have added in a few animations on the player sprite and one of the is the punching animation. I understand that in order for the game to know that when the player sprite's fist hits the enemy then a collusion will have to be on the fist. I tried adding a collusion box to the fist but it seemed to be displaying correct on the mirrored side of the sprite but not on the non-mirrored side as i'm guessing the imagepoint causing the issue.

2) How do i after pressing the punch button (k), the animation will end? Right now when i press and hold the button K, the punch animation stays there instead of going back to the idle animation.

3) Also, after i press the punch button (k), the collusion box stays at where the last animation is played. How do i also after the punch animation ends the collusion box disappears too?

4) I tried to have the enemies chase the player around the game but there's 2 things i can't get my head around which is 1) Make the AI able to jump on the platforms and chase the player 2) Why are my enemies all turning in all different directions and not walking on the ground as they are supposed to?

I have attached my capx file for the pros here to take a look.
You do not have the required permissions to view the files attached to this post.
B
11
S
2
Posts: 61
Reputation: 704

Post » Sun Apr 06, 2014 11:28 pm

Bump! Anyone can help? Thanks thanks thanks! :)
B
11
S
2
Posts: 61
Reputation: 704

Post » Mon Apr 07, 2014 12:05 am

First off I'll tackle the easier problem first. You enemies rotate because on the pathfinding behaviors you need to set rotate to no. I'll look into the other issue if I have the time.
B
29
S
6
G
1
Posts: 93
Reputation: 3,020

Post » Mon Apr 07, 2014 3:45 am

Instead of using the "key is down" use "Key is pressed" It should give you the action you are looking for. Also try using the "player"- "animations" under the add actions. You could set it up where the hit box will only be set up when the animation is playing.

As for the AI i do not have to much experience with that right now, I am learning more for it.
B
29
S
6
G
1
Posts: 93
Reputation: 3,020

Post » Mon Apr 07, 2014 4:53 am

Hi!

Thanks for the help so far! I have switched off rotation for the enemy but they seemed to bouncing on the floor thou.

I did try both "Key is down" and "key is pressed", i still get the same issue which i can hold down the button and the animation stays there.
B
11
S
2
Posts: 61
Reputation: 704

Post » Mon Apr 07, 2014 5:02 am

For collisions, you can do what I do and add another invisible box that floats out in front of the character AND another one for the enemies so when they overlap and you hit attack, it knows to do the attacking routine. This might help with the other issue, gets rid of the need for collision boxes. Sure it's more stuff loaded, but platformers are picky by nature.
B
27
S
6
G
6
Posts: 267
Reputation: 3,750

Post » Mon Apr 07, 2014 5:07 am

@roacle which means the animation itself you add in another invisible box?
B
11
S
2
Posts: 61
Reputation: 704

Post » Mon Apr 07, 2014 5:19 am

you need to make it where when the animation of the punch ends it goes back to idle
also idk how you did it but your punch animation is glitched and it seems to be over ridding the default animation
I fixed it by duplicating punch and renaming it to punch1.
B
29
S
6
G
1
Posts: 93
Reputation: 3,020

Post » Mon Apr 07, 2014 5:49 am

Did you solve your issue?
I am also busy with a platformer. With fighting combos.
The following works properly with animations cycling as they should.

Attack + press nothing else = Attack then go to idle.
Attack + Attack = Attack followed by kick animation.
Attack + Attack + Attack = Attack followed by Kick followed by Slice Animation
Jump + in air + kick = Flying kick
Jump rapidly pressing attack = Low Flying kick

All of these work well with enemies detecting collisions and dying when struck.
I also made enemies get damaged if you kick an enemy into another enemy.

Point is, if you did not fix your issue i will have a look, but sounds like you fixed it.
B
8
S
2
Posts: 163
Reputation: 1,115

Post » Mon Apr 07, 2014 6:05 am

@Ldk Sorry i can't seem to solve this issue. Neither for the AI part. Been messing around the codes but seemed to be stuck.

Looks like it's easier to make a shooter game than a melee fighting game thou.
B
11
S
2
Posts: 61
Reputation: 704

Next

Return to How do I....?

Who is online

Users browsing this forum: AkbarAsgharMG and 25 guests