//---------------------------------------------------------------------------------------- // Create Level //---------------------------------------------------------------------------------------- /// <summary> /// Create level /// </summary> #region Create Level void createLevel(string filename) { TiledLoader loader = new TiledLoader(filename); loader.OnObjectCreated += Loader_OnObjectCreated; //Layer without collider loader.addColliders = false; loader.LoadTileLayers(0); //Layer with collider loader.addColliders = true; loader.LoadTileLayers(1); //Object layer connect with classes loader.autoInstance = true; loader.LoadObjectGroups(0); if (levelNumber == 2) { enemyBoss.createPlayer(player); } foreach (Enemy enemy in enemies) { enemy.createPlayer(player); } check = new Check(player, levelNumber); foreach (TRex trex in trexs) { trex.createPlayer(player); } foreach (Enemypack enemypack in enemypacks) { enemypack.createLevelInst(this); enemypack.getPlayer(player); } if (levelNumber == 3) { mummykiller.createLevelInst(this); mummykiller.createPlayer(player); } }