Enemy movements; multiple characters; and for each

Get help using Construct 2

Post » Fri Dec 13, 2013 2:10 pm

Hi!

I made a thread before about a grid game; thought of putting this in that thread but I have progress a lot so I feel appropriate to post some questions in a new thread.

https://www.dropbox.com/s/4wb280i50dyyk8x/Galah%20Panjang.capx

Above is my current .capx file. I just finished doing the core structure of the game with just one level for now.

So far, I managed to make the enemy's movement to worked, although still very glitchy. Sometimes it keeps going to the left at the start of the screen or when it killed my character sprite.

Speaking of which, do I need to use the For Each to apply the same conditions and events to multiple characters and enemies? Or do I have to do it individually?
B
6
Posts: 35
Reputation: 375

Post » Fri Dec 13, 2013 2:19 pm

You should edit the groups "enemy has target" and "enemy no target" and set them to not active on start. That takes care of the problems at start.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Fri Dec 13, 2013 2:53 pm

I see.

Thanks!!

Any idea what I should do for multiple character sprites and enemies?
B
6
Posts: 35
Reputation: 375

Post » Sat Dec 14, 2013 5:17 pm

Ok, I got kinda lost: how should I edit the "enemy no target" and "enemy has target"??
B
6
Posts: 35
Reputation: 375

Post » Sat Dec 14, 2013 5:32 pm

Right click on the group name, choose edit, remove the thingie from the checkbox active on start.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sat Dec 14, 2013 6:03 pm

*facepalm*

I didn't see that...

Thanks dude!!
B
6
Posts: 35
Reputation: 375

Post » Tue Dec 17, 2013 10:06 am

So I've been organizing the events:






The second enemy (blue) reacted when the character (cyan) is close to enemy 1 (yellow). I kept the enemies inside the Enemy Family so that I don't end up having to make the same events for each enemies. Is there a way to make enemy 2 react only when my character is near it rather than being near enemy 1?

Also, I plan to make the third enemy to move in the direction of those red lines. How to apply different events for the enemies while still retain them in the family folder?

Here's my current .capx file:

https://www.dropbox.com/s/4wb280i50dyyk8x/Galah%20Panjang.capxPaletteRider2013-12-17 10:11:55
B
6
Posts: 35
Reputation: 375

Post » Tue Dec 17, 2013 10:09 am

You can still reference your objects by their own name even though they are in a family.

So you could have events that are the same for all family members and events that are just for enemy 1, or enemy2, or enemy3 sprites.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Dec 17, 2013 10:13 am

I see. Thanks!
B
6
Posts: 35
Reputation: 375

Post » Tue Dec 17, 2013 10:17 am

But in this case I think adding a for each family condition to the two target detection events would work.

Oh, on second thought, adding a condition to the has target events is necessary. Add a condition has target to those two events and the above mentioned for each shouldn't be necessary..

The has target events now affect all family members when the group is activated.LittleStain2013-12-17 10:22:20
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Next

Return to How do I....?

Who is online

Users browsing this forum: unxcellent and 4 guests