Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private function CreateMinimap():void
- {
- // create a buffer the same size as your game world
- // fill it with nothing (0% alpha and no pixels drawn on it)
- minimapDisplay = new BitmapData(WORLD_WIDTH, WORLD_HEIGHT, true, 0x00000000);
- // loop over the game world exploration grid
- var gh:Number = Global.exploredMap.rows;
- var gw:Number = Global.exploredMap.columns;
- for (var gy:Number = 0; gy < gh; gy++)
- {
- for (var gx:Number = 0; gx < gw; gx++)
- {
- // if the tile has been explored, draw it on the minimapDisplay
- if (Global.exploredMap.getCell(gx, gy))
- {
- // draw a cyan 100% alpha pixel to show that we have explored this tile
- minimapDisplay.setPixel32(gx, gy, 0xFF00FFFF);
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment