示例#1
0
        /// <summary>
        /// Initialize CollisionHandler by passing it the collision map. An individual image fraction is then refered to as a zone.
        /// </summary>
        public static void Initialize(CollisionMap _map, List<Enemy> enem, Player player, List<Platform> plat, List<Ladder> ladders, ContentManager _content)
        {
            for (int i = 0; i < enem.Count; i++)
                gameObjects.Add(enem[i]);
            for (int i = 0; i < plat.Count; i++)
                gameObjects.Add(plat[i]);
            for (int i = 0; i < ladders.Count; i++)
                gameObjects.Add(ladders[i]);

            gameObjects.Add(player);

            content = _content;

            Map = _map;

            resizeFactor = Map.ResizeFactor;

            Map.LoadAllTextures(_content);
            Map.LoadAllTextureData();

            zone_height = Map.CropSize.Y;
            zone_width = Map.CropSize.X;

            map_width = Map.CropSize.X * Map.Fractions / 2;
            map_height = Map.CropSize.Y * 2;
        }