How do I track on a minimap enemy instances?

Get help using Construct 2

Post » Sun Nov 08, 2015 4:54 pm

I know how to do the trick with one, but i am getting really embarrassed dealing with a group;
A plus would be to use containers merging the map marker and enemy sprite.
B
7
S
3
G
1
Posts: 154
Reputation: 1,812

Post » Sun Nov 08, 2015 5:04 pm

Without seeing how you have set up your events..

Use a for each enemy event to create/set the position of the map marker on the minimap..
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 » Mon Nov 09, 2015 2:02 am

@LittleStain lets suppose I have several instances of the sprites "enemy" and "mapmarker".
Your solution is: =For Each enemy: set mapmarker x and y on map...

The first problem is the game doesn't know which "mapmarker" to pick.
B
7
S
3
G
1
Posts: 154
Reputation: 1,812

Post » Mon Nov 09, 2015 10:23 am

Give both the mapmarker and enemy an instance variable and check if they are the same?
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 » Mon Nov 09, 2015 2:41 pm

@LittleStain Your solution is:
On enemy created: create mapmarker, set mapmarker.owneruid to enemy.iid
For Each enemy | mapmarker.owneruid==enemy.iid: set mapmarker x and y on map...

My wrong doing was that I didn't put my newly created mapmarker on HUD layer ><

Thx!
B
7
S
3
G
1
Posts: 154
Reputation: 1,812


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 13 guests