Build an in game mini-map
Toby
Member Posts: 478
The mechanics of my game are pretty much complete, just wondering if anyone has managed to build a minimap in GS.
A minimap, for clarity - a small representation of the map in the corner of the screen showing your position in relation to the larger map.
I have the map graphic on screen in the correct position with a level of transparency(Bottom LHS), how do you go about plotting the position with a red dot on the map relative to the ship XY position? Trig again, or is there a simple solution?
A minimap, for clarity - a small representation of the map in the corner of the screen showing your position in relation to the larger map.
I have the map graphic on screen in the correct position with a level of transparency(Bottom LHS), how do you go about plotting the position with a red dot on the map relative to the ship XY position? Trig again, or is there a simple solution?
Comments
If the mini-map is 1/4 the size of the level...
Constrain the location of the red dot to 1/4 the location of the green dot.
With this solution, though, you're stuck placing the mini-map in the top left (or bottom left?) corner. Just add an offset (besides the 1/4) to fix it. ... did that come out coherent at all?
http://gamesalad.com/wiki/how_to_create_a_minimap
Then dynamically assign each attribute 1>5 as they appear.
You would need to work out some checking process to see what game.attributes were available as a spawned enemy actor is created. Eg: 1,2,4,5 being used, assign 3.
The enemy would obviously have the constrain X & Y applied with the offset.
OR you could......
Just duplicate your enemy actor 5 times in the actor library.
Add unique names, then apply the unique XY game.attributes.
Apply the constrains behaviors and have your spawning actor spawn all 5 enemy actors.
There's probably an easier way, all I can think of at the moment - perhaps Codemonkey or someone can make a suggestion?
That way when your enemy is created it constrains the X/Y & spawns the dot.
Under the dot Constrain X/Y to your mob actor 1/4, like they say above.
I found out that you only need 1 game.attribute to keep track of the X/Y of ALL instances of any mob. I used to create an X/Y of every mob type. But you don't need to. So even if you create multiple instances it will still constrain it to each instance.
-JGary
Can the spawned "Actor Map Dot" be on the HUD if the enemy is not on the HUD?
I was well chuffed when it worked first time as intended!
I'll try and dig it up and share!
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
It works fine, as detailed here: http://gamesalad.com/wiki/how_tos:create_a_minimap
The issue is that as well as showing the player dot on the radar, a second 'flashing dot' appears on the main screen.
As far as I can tell it looks like the player dot is trying to appear at the player's X/Y coords *as well as* where I've told it to on the radar...
Is this a glitch, perhaps???
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
Cheers,
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io