How do I spawn enemies with different instance variables?

Get help using Construct 2

Post » Tue Jan 03, 2017 2:33 pm

Message: LongBen can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
I am making a top-down games in wich the player needs to kill zombies. The zombies are spawning in every 5 seconds to a sprite.
When the distance between the player and the zombie is less or equal to 50 the zombie changes its animations because the instance variable changed from "IDLE" to "ATTACK".
My problem is that not just that zombie changes its animation wich is near the player. Every zombie starts to attack when one is near the player.
Here is the game:
https://www.dropbox.com/sh/dpmqrghp31zz%20...%200-E7a?dl=0




(Sorry for my English)
B
3
Posts: 5
Reputation: 181

Post » Tue Jan 03, 2017 6:18 pm

I can not open that truncated link.
But, this is (one of many) a simple way to do this.

https://www.dropbox.com/s/i2pua0anoyz5p ... .capx?dl=0
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Tue Jan 03, 2017 6:49 pm

Didn't read through any of the .capx 's, but try to add a "For each Zombie" in front of the condition that checks the distance between the player and the zombie.
"We can't solve problems by using the same kind of thinking we used when we created them."
- Albert Einstein
B
27
S
11
G
8
Posts: 528
Reputation: 7,091

Post » Tue Jan 03, 2017 7:25 pm

randomly wrote:Didn't read through any of the .capx 's, but try to add a "For each Zombie" in front of the condition that checks the distance between the player and the zombie.

This will work, i dont see why not, OP have you tried it?
B
7
S
1
Posts: 50
Reputation: 556

Post » Fri Jan 06, 2017 1:21 pm

randomly wrote:Didn't read through any of the .capx 's, but try to add a "For each Zombie" in front of the condition that checks the distance between the player and the zombie.

Thank you! It worked!
B
3
Posts: 5
Reputation: 181


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 11 guests