enemy sprites not acting individually

Get help using Construct 2

Post » Thu Dec 04, 2014 4:15 pm

I know it's a simple solution but I've been staring at this too long and can't figure it out. All the zombie animations are acting as one rather then individually. Any help would be appreciated. Thank you.
Image
B
61
S
20
G
56
Posts: 1,077
Reputation: 35,986

Post » Thu Dec 04, 2014 7:00 pm

I think its because in the last event you pick all the zombiea... And set them to the position of a (probably the first instance) zombiecollider.

You need to tell construct what zombiea.... To pick else it just does it for every instance. So you need to set its position in the events above i guess...

Could anyone back me on this or am i horribly wrong?
B
4
Posts: 12
Reputation: 224

Post » Thu Dec 04, 2014 7:28 pm

@lexustg From what I can tell the zombieanimations are positioning themselves correctly on the zombiecolliders, just all the animations are the same.
B
61
S
20
G
56
Posts: 1,077
Reputation: 35,986

Post » Fri Dec 05, 2014 2:47 am

It's hard to be certain because looking at the image is harder than messing with an event sheet. Here are my thoughts...

If you are not using containers, none of the animation calls define which ZombieAnimation you are referencing. I suspect that you are using Containers, though, so you can probably ignore this second point, I only mention it in case you are not...

Where you have ShieldSprite -> On collision with ZombieCollider, you set ZombieAnimation to "down". That trigger is called within your For each ZombieCollider loop, which is unnecessary and requires forced collision checking (more overhead, negates collision cells) than if you had the trigger at the 'root' of the event sheet.

Also, the subsequent For each ZombieAnimations is not required, as the sub event should stand alone and function correctly without it. I would advise against using a wait 3 seconds before commanding what the ZombieAnimation should do next because there's scope for referenced objects to get mixed up. Just add a timer behavior to the animation object and set it to trigger in time + 3 secs, then use that trigger to change the animation.
A big fan of JavaScript.
B
74
S
20
G
69
Posts: 2,215
Reputation: 43,852

Post » Fri Dec 05, 2014 5:15 am

Yeah, I'm sure it's a picking issue, I'm just not sure how to deal with the picking in this circumstance.

EDIT: Ok, I feel like an idiot but my containers weren't set up properly. Issue fixed.
B
61
S
20
G
56
Posts: 1,077
Reputation: 35,986


Return to How do I....?

Who is online

Users browsing this forum: amazingdream, Google [Bot] and 23 guests