예제 #1
0
        public static void Load(ContentManager cm)
        {
            if (map != null)
                map.Reset();

            MapContentManager = cm;
            map = MapContentManager.Load<Map>("Maps/Start");
            font = MapContentManager.Load<SpriteFont>("Arial");
            boxTexture = MapContentManager.Load<Texture2D>("Textures/tile");
            Map.CollisionTexture = MapContentManager.Load<Texture2D>("Textures/collision");
            Map.BlockTexture = MapContentManager.Load<Texture2D>("Textures/block");
            Block b = new Block();
            b.Position = new Vector2(5, 4);
            b.Size = new Vector2(32, 32);
            b.IsMoveable = true;
            map.Blocks.Add(b);
            map.SetIndex(LayerType.Collision, (int)b.Position.X, (int)b.Position.Y, 1);

            player = new Player();
            Player.Load(MapContentManager, "Textures/Player");
            Player.Position = new Vector2(64, 64);

            fadeIn = true;

            fadeTexture = MapContentManager.Load<Texture2D>("Textures/fade");
        }