Guest User

Untitled

a guest
Jul 21st, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. private function CreateMinimap():void
  2. {
  3. // create a buffer the same size as your game world
  4. // fill it with nothing (0% alpha and no pixels drawn on it)
  5. minimapDisplay = new BitmapData(WORLD_WIDTH, WORLD_HEIGHT, true, 0x00000000);
  6.  
  7. // loop over the game world exploration grid
  8. var gh:Number = Global.exploredMap.rows;
  9. var gw:Number = Global.exploredMap.columns;
  10.  
  11. for (var gy:Number = 0; gy < gh; gy++)
  12. {
  13. for (var gx:Number = 0; gx < gw; gx++)
  14. {
  15. // if the tile has been explored, draw it on the minimapDisplay
  16. if (Global.exploredMap.getCell(gx, gy))
  17. {
  18. // draw a cyan 100% alpha pixel to show that we have explored this tile
  19. minimapDisplay.setPixel32(gx, gy, 0xFF00FFFF);
  20. }
  21. }
  22. }
  23. }
Add Comment
Please, Sign In to add comment