Ejemplo n.º 1
0
        private void LoadMapAndPlayer()
        {
            //load Model with Animation and Textures ( UV-Mapping)
            m_player = new AnimatedModel(GameConstants.Content, "AnimatedModels/PlayerModell", "AnimatedModels/MAINTEXTURE");

            //load Light-Shader for Ambient,Diffus,Specular Light
            //GameConstants.lightEffect = GameConstants.Content.Load<Effect>("FX/Test");

            String bitmapname = "Content/Maps/" + iLevel.ToString() + ".bmp";

            if (GameConstants.isDebugMode)
            {
                Console.WriteLine("bitmap: " + bitmapname);
            }
            levelMask = new Bitmap(bitmapname);
            testmap   = null;
            testmap   = new Map(levelMask);

            //after Map generation
            objectSpawner = new Spawner();
            start         = GameManager.Instance.StartPos;

            objectSpawner.PlaceCoins(testmap.map);
            MaxCoins = GameManager.Instance.getCoinList().Count;
            Player   = new Player(m_player);
            // x_playerModelTransforms = SetupEffectDefaults(m_player);
            Player.Spawn(new Vector3(start.X, start.Y, 0));
            GameConstants.MainCam.SetTarget(Player);
            PController = new PlayerController(Player);
            TrapHandler = new TrapHandler();


            //Loads Textfile where Animation Settings are written
            m_player.LoadAnimationParts("AnimationParts/Animations.txt");
            //searching for the Animation you are looking
            m_player.BlendToAnimationPart("Run");
        }