Some help with my enemies?

Get help using Construct 2

Post » Mon Jan 25, 2016 11:56 pm

Hi Everyone!!

I had making some test with "Tower Defense" game like.
And i have 2 enemies in "Enemy" Family and 1 Crate in "Defenses" Family
The Enemy family have a instaces variables ( Speed, TimeAttack, Attack (Damage) ) and a timer
And Defenses family have only HP variable

The enemies "runs" with a bullet behaviour and when crash with a defense then stop and attack with a timer
each enemy have different timeAttack, speed etc etc

Image

But they are not attacking.. if enemy destroy one defense all instaces destroyed (Although defenses are in a family)
and if one enemy has stopped then don't continues his way.. i've tried to give a Attacking/not attacking instance to EnemyFamily but didn't worked yet.
B
4
Posts: 8
Reputation: 218

Post » Tue Jan 26, 2016 1:42 am

If you want to select an object that have many instances, you need to select it by UID or perform the action directly under the trigger that has the selection events (for example on collision and such). If not, every instances that fulfills the conditions in the events will be selected.
B
36
S
17
G
30
Posts: 679
Reputation: 19,254

Post » Tue Jan 26, 2016 11:50 am

I need to pick by UID? i never undestood the UID and the pick.
May be i need to make this: Enemy When overlapping defenses, pick by uid and the rest of the code Attack, etc etc?
B
4
Posts: 8
Reputation: 218

Post » Tue Jan 26, 2016 12:57 pm

You will need to read the manual on these as they are very important to making any games. For your case, if you are running the actions right after the trigger, you won't need to use UID. For example, enemy on collision with bullet, any events directly under that event will be run only for that enemy because it knows which enemy you want effected. But if you put the actions on another event that has no way of selecting he enemy sprites, it will select every single one of them.
B
36
S
17
G
30
Posts: 679
Reputation: 19,254


Return to How do I....?

Who is online

Users browsing this forum: jpstudio, manujorgo, Romalex360, tunepunk, VnM2016 and 10 guests