—
Hey,
Your problem is quite clear here : the link between an object and its map representation isn't defined. To put it more clearly, how would the map update an enemy position if each enemy_icon isn't "connected" to an enemy ? I don't see, as a computer, how I would do it as your system is right now.
So the solution now.
1/ you need a map initialization. In the initialization, you'll spawn an enemy icon for each enemy on the game. Same goes for energy, so I'll just explain for the enemy for now. Every icon needs a variable, "targetUID" for example. This variable is set during the initialization to the enemy.UID. The positioning is then done exactly like you did for the player icon.
2/ you need a map icon adding system, to spawn a new icon on the map every time a enemy is spawn.
3/ during the map actualization, position the player icon like you did, then do a forEach on all the enemies, select the corresponding enemy_icon on the map (using the variable we added in 1/), and then position the icon on the map.
I see you have a licence for C2, so I'd suggest you use families for "mappables" objects (i.e. the objects of the game that have a map icon) and a family of "map_icons", as all those icons have exactly the same way of initializing/updating/destroying.
I hope this explanation is enough, I'll put some code in if you need though. Don't hesitate to ask if anything isn't clear.