Dynamic Alpha - Tiles

BlitzMax Forums/BlitzMax Programming/Dynamic Alpha - Tiles

Matt Vinyl(Posted 2007) [#1]
Hi all...

I'm working on a 2d tilemap game (similar to Alien Breed on the Amiga but less action - more strategy. I believe there was a good remake by a Blitzster!).

My question is this: I want unexplored areas of the map to 'fade in' when the player gets within a certain distance of it. Once a player has explored an area, it will stay fully visible. Would it be best to assign each tile an alpha value and have that incremented (if it is less than 1) depending on how near the player is to it?

It should be pretty easy to implement, but I would appreciate comments on whether this is a viable method, or may be too system-intense?

:)


Dreamora(Posted 2007) [#2]
as only few tiles are on screen and most are not drawn most of the time, this shouldn't be a problem.


TartanTangerine (was Indiepath)(Posted 2007) [#3]
Or use my lighting module : modules.indiepath.com (won't work on latest version of BMAX though)


Matt Vinyl(Posted 2007) [#4]
Thanks for the response chaps - will give it a go. ;)


HrdNutz(Posted 2007) [#5]
You mean a 'Fog of War' type of thing? You could keep a separate grid aligned with your tilemap that just keeps track of and marks your explored tiles. When you draw, use this grid as a reference, and use appropriate colors/alphas for the tiles. Or you can have your tiles store additional values if they are explored yet or not.