示例#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()
        {
            tmapRenderer = (ITilemapRenderer)Game.Services.GetService(typeof(ITilemapRenderer));
            score = (ScoreData)Game.Services.GetService(typeof(ScoreData));
            collisions = (ICollisionManager)Game.Services.GetService(typeof(ICollisionManager));
            sfx = (Dictionary<string, SoundEffect>)Game.Services.GetService(typeof(Dictionary<string, SoundEffect>));

            Game.Services.AddService(typeof(IEscapeeManager), this);

            base.Initialize();
        }
示例#2
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();
        }