Animation issue

Get help using Construct 2

Post » Sun Aug 18, 2013 12:17 pm

Hi again guys,

I have a problem...

https://dl.dropboxusercontent.com/u/190108463/Enemy.capx

Why the animation does not changes when I hit the enemies?
To hits an enemy click on it. More two clicks will kill it but the relative animation does not start, why?

Thx, in advance...
B
13
S
4
G
1
Posts: 74
Reputation: 1,230

Post » Sun Aug 18, 2013 1:36 pm

@parside

Event 6 is overriding the anims as you have it set to play "default" constantly as long as hits are <2. Delete event 6 and it's fine
B
46
S
16
G
78
Posts: 2,170
Reputation: 46,357

Post » Sun Aug 18, 2013 2:04 pm

I have tried but nothing changed...
https://dl.dropboxusercontent.com/u/190108463/Enemy.capx
The Death (5 frames) or hit (only 1 frame) animations don't start.
B
13
S
4
G
1
Posts: 74
Reputation: 1,230

Post » Sun Aug 18, 2013 2:18 pm

@parside
You've also named the anims wrong in the event sheet. they are named "hit" and "death", you've called them "colpito" and "morto". Update the names and it works fine.
B
46
S
16
G
78
Posts: 2,170
Reputation: 46,357

Post » Sun Aug 18, 2013 6:48 pm

Yes, sorry.
I have translated in english and forgot to change them...

Thx a lot...
B
13
S
4
G
1
Posts: 74
Reputation: 1,230

Post » Sun Aug 18, 2013 6:50 pm

However there is another problem now...
The monsters will be all hit and killed.
How can I do to kill only that I have touched?
parside2013-08-18 18:50:48
B
13
S
4
G
1
Posts: 74
Reputation: 1,230

Post » Sun Aug 18, 2013 7:07 pm

It's because when you touch Enemy, all objects are Enemy so it affects every monster. I would redo some of the logic : rather than pin the animation to the Enemy objects, you could create the animation objects and when one is touched you teleport a target to the animation object and it takes a hit. They way you've set it up currently makes it difficult to determine which enemy you are hitting as they are all the same object with the same name. Lots of ways to rework it though, have fun! : D
B
46
S
16
G
78
Posts: 2,170
Reputation: 46,357

Post » Sun Aug 18, 2013 7:42 pm

Ok, Thx a lot...
I have solved adding an instance variable to the animation. I toggle it when I kill an enemy and then I check it.

It works good...

Thx a gain...
B
13
S
4
G
1
Posts: 74
Reputation: 1,230


Return to How do I....?

Who is online

Users browsing this forum: Artcadev, Blendi1223, dop2000 and 57 guests