Esempio n. 1
0
        /// <summary>
        /// Allows the game component to perform any initialization it needs to before starting
        /// to run.  This is where it can query for any required services and load content.
        /// </summary>
        public override void Initialize()
        {
            collisions = (ICollisionManager)Game.Services.GetService(typeof(ICollisionManager));
            camera = (GameCamera)Game.Services.GetService(typeof(GameCamera));
            tmapRenderer = (ITilemapRenderer)Game.Services.GetService(typeof(ITilemapRenderer));
            sfx = (Dictionary<string, SoundEffect>)Game.Services.GetService(typeof(Dictionary<string, SoundEffect>));

            p.SetupGraphics(Game);

            collisions.AddEntity(p);

            base.Initialize();
        }