# Naming maps

**URL:** <https://forum.kirupa.com/t/naming-maps/247158>\
**Category:** programming\
**Created:** [December 19, 2007, 12:44am UTC](https://forum.kirupa.com/t/naming-maps/247158 "2007-12-19T00:44:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tsukimaru](https://avatars.discourse-cdn.com/v4/letter/t/278dde/32.png) [@Tsukimaru](https://forum.kirupa.com/u/Tsukimaru)\
**Post date:** [December 19, 2007, 12:44am UTC](https://forum.kirupa.com/t/naming-maps/247158/1 "2007-12-19T00:44:19Z")

</div>

In Tonypa’s tile map tutorials, he names his map arrays myMap1, myMap2, and so on. He sets currentmap to 1, and then calls his map building function with buildMap(\_root[“myMap”+game.currentMap]); so he can just change the currentmap number when he goes to a different room.

I think it’ll be hard to remember which map “myMap1” corresponds to. What I want to do is make it so I can name my map arrays things like Castle and Town, and call it with something like buildMap(//name of map array);  
I’ve tried a few different ways, but none of them work. What’s the best, simplest way to do this?
