Dynamic Alpha - Tiles
BlitzMax Forums/BlitzMax Programming/Dynamic Alpha - Tiles
| ||
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? :) |
| ||
as only few tiles are on screen and most are not drawn most of the time, this shouldn't be a problem. |
| ||
Or use my lighting module : modules.indiepath.com (won't work on latest version of BMAX though) |
| ||
Thanks for the response chaps - will give it a go. ;) |
| ||
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. |