Mini Map Tracking issue

SingleSparqSingleSparq Member Posts: 1,339
edited November -1 in Working with GS (Mac)
This is to demo a mini map tracker.(based on the mini map demo)
http://gamesalad.com/game/play/30767

Like in the old defender games where enemies would appear on a mini map of the scene layout.

As the orange actors are randomly displayed the actor also spawns the mini dot actor and tracks the main object as the position moves.

Unfortunately there is one problem with this scenario. If you hit your right movement key to scroll the scene, you will note the mini dots do not stay in the map HUD - this is because they (like the orange actor) are spawned on a scrollable layer. The catch 22 is that in order to track the Orange objects individually the orange object must spawn the mini objects (and the Orange object need to be on the scrollable layer).

If I change it where the mini object is not part of Orange object and on it's own (non-scrolling) layer it will only track one object at a time.

Does anyone know of a different way to achieve what I've done here with Orange Actor (on scrolling layer) that can be tracked with a mini Actor (on non-scrolling layer )for each instance of that Orange Object?

Comments

  • scitunesscitunes Member, Sous Chef Posts: 4,047
    I have a working mini-map and it is very tedious. I actually had to create separate actors for each bad guy even though they are all identical. Then I created a real type game attribute for X and Y for each bad guy. Then in in bad guy1 I constrained game.badguy1x to self.position.X and game.badguyy to self.position.Y and same for badguy 2 except game.badguy2x and game.badguy2y and so on. Then I created a separate actor called "badguy dot" and I constrained its X and Y to the game attributes I created earlier and again for all of the other dots using the correct game.badguy attributes. I constrain them using this formula:

    game.badguy1x / (map scale - see below) + offset

    So lets say your scene is 1000 pixels wide and the mini map is 100 pixels wide your map scale would be 10 because 100 is 1/10 of 1000.

    The offset number is simply how far your minimap is placed from the edge of the screen.

    Just make sure that you place the dot actors on a non-scrolling layer. Good Luck!
  • SingleSparqSingleSparq Member Posts: 1,339
    Hi, thanks for the reply - don't think I'm willing to give up the usage of random (single instance) enemies just yet. Anyone from Gamesalad team - will the ability to spawn and actor to a layer other than the one your on be possible in the future?
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    You can still make their positions random. You could place each actor offscreen from the start. And give them a rule that changes their x and y using a change attribute - just set it to random. You would still have to go through everything I listed above (which is a pain) but when the bad guys go to their random spots when the scene loads the dots will follow them on the mini-map. so if the mini map is essential and you need randomness then you could do it that way (or wait until GS offers the spawn to different layer feature) hint, hint ;-)
  • SingleSparqSingleSparq Member Posts: 1,339
    Yes that seems to work - guess I can take the disadvantage and turn it into an advantage by at least making my objects different with the hope that the user will destroy the object allowing others to come onto the screen and show on the mini map. Thanks for the tips.
Sign In or Register to comment.