How do I create enemies that are the same sprite & move rand

Get help using Construct 2

Post » Tue Sep 09, 2014 4:40 am

How can I create enemies that are the same sprite but move independent from each other. I have attached .capx

Also when one is hit, it will be destroyed. But the other (skeletons) won't die.
You do not have the required permissions to view the files attached to this post.
B
5
S
1
Posts: 38
Reputation: 482

Post » Tue Sep 09, 2014 6:13 am

You need to put that one enemy into a family (fam_enemies), then for any bullet collision checks, use fam_enemies instead of the enemy type you're hitting. Families in C2 work by applying conditions of the family only to instances within that meet the conditions. Therefore, to also make them move randomly, when using System -> Create object and the sprite, after that line you need to look into implementing a waypoint system. I haven't attempted it yet, but it should be as simple as spawning a transparent object at a random X and Y position, then sending that spawned sprite off to that transparent object. Then on fam_enemies and in a separate check after spawning, you'd want to check if it collides with the transparent object and if so, to make another and send the ship that collided (again, this is automatically detected since it's in the family, and we're checking the family, not the sprite) to the new one.
Founder of Jadelight Studio, Developer of Libertas Aedifex, regular C2 Help contributor and fan of ambient music and Star Wars.
B
12
S
4
Posts: 255
Reputation: 2,008

Post » Tue Sep 09, 2014 6:16 am

jminfantem wrote:How can I create enemies that are the same sprite but move independent from each other. I have attached .capx

Also when one is hit, it will be destroyed. But the other (skeletons) won't die.


Isn't this rather similar to your other thread? Except you added the bit about them being hit. The attached capx has some fundamental errors.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596


Return to How do I....?

Who is online

Users browsing this forum: tdcostas and 1 guest