One component of nearly any shooting game, especially when multiple players are involved, is a mini-map to inform the player of unit positions. This is something we felt was necessary for our game and was part of our recent developments. When rendering a mini-map, any information necessary needs to be re-rendered to the small portion of the screen that is meant for the map.
To do this, a simple algorithm is used to scale down unit positions for the mini-map. The algorithm is as follows:
x position = mini-map screen coordinate + unit x coordinate * (mini-map width / main map width)
You do this for both the x and y coordinates and then draw a small shape or texture to the screen at the location. This draws a nice indicator for the unit in correct screen space for the player to enjoy. You can also play with effects to get player attention. For instance, our end level objective pulses to ensure the player knows about this important location.
That's it for this post, check back for more development updates coming soon!
Friday, December 9, 2011
Navigation at it's finest
Posted by Brian Pike on 11:11 AM
0 comments:
Post a Comment