var a = new tileObj('features',0,0,false);
var w = new tileObj('features',32*4,0,true);
var d = new tileObj('features',32*1,32*7,false)
var l = new tileObj('features',32*3,32*3,false)
var s = new tileObj('features',32*3,32*9,true)

//tileMap = null;
tileMap =
[	[w,w,w,w,w,w,w,w,s,w],
	[w,a,a,a,a,a,a,l,l,w],
	[w,a,a,a,a,a,a,a,a,w],
	[w,a,a,a,a,a,a,a,a,w],
	[w,a,a,a,a,a,a,a,a,w],
	[w,a,a,a,a,a,a,a,a,w],
	[w,a,a,a,a,a,a,a,a,w],
	[w,a,a,a,w,w,a,w,w,w],
	[w,a,a,a,w,d,a,a,l,w],
	[w,w,w,w,w,w,w,w,w,w]]
	
var eventMap = new Array(10);
for(e=0;e<eventMap.length;e++){
	eventMap[e]=new Array(10);
}
//eventMap arr y x - eventobj x y
eventMap[8][2] = new eventObj('treasure',2,8,"You found the treasure!");
eventMap[8][5] = new eventObj('exit',5,8,"You have found the exit!");
eventMap[8][5].type='goto'
eventMap[8][5].toMap = 'http://www.andrewwooldridge.com/canvas/canvasquest/lvl_002.js';
eventMap[3][1] = new eventObj('sign',1,3, "Get to the end to win!");
eventMap[5][4] = new eventObj('beef',4,5, "Yum!");

function levelSetup(){
  theGame.currMap = 'lvl_001.js';
  theGame.theChar = new charObj('uniques',0,0,32*8,32);
  theGame.theChar.type = 'player';
  theGame.theChar.health = 200;
  for(i=0; i<5; i++){
  		theGame.monstArr[i] = new charObj('uniques',32 * (Math.floor(Math.random() * 10)),32 * (Math.floor(Math.random() * 10)),32*8,32*8 )  		
  		theGame.monstArr[i].health = 10;
  }
  theGame.itemArr = new Array();
  theGame.itemArr[0] = new charObj('misc',32,0,32*2,32*8);
  theGame.itemArr[0].type = 'treasure';
  theGame.itemArr[0].gold = 1000;
  theGame.itemArr[0].health = 1;
  
  theGame.itemArr[1] = new charObj('misc',32*0,32*11,32*1,32*3);
  theGame.itemArr[1].type = 'notice';
  theGame.itemArr[1].gold = 1;
  theGame.itemArr[1].health = 1;

  theGame.itemArr[2] = new charObj('food',32*4,32*0,32*4,32*5);
  theGame.itemArr[2].type = 'food';
  theGame.itemArr[2].gold = 0;
  theGame.itemArr[2].health = 10;  
  
}

resCount(); // tell mother ship weve been loaded
	

