예제 #1
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            _graphicSettings.Initialize();

            CustomContentLoader loader   = new CustomContentLoader(this.Content);
            CustomWorld         world    = new CustomWorld(new CustomPhysicGenerator(loader));
            Tracker             tracker  = new Tracker(world.Player, 15f);
            Renderer            renderer = new BasicRenderer(_graphicSettings, Content, 45f, tracker);

            _logic   = new LogicManager(world);
            _graphic = new GraphicManager(_logic, tracker, renderer, new CustomGraphicGenerator(loader));

            CustomActionList actionList = new CustomActionList(this, _graphicSettings, world, tracker);
            KeyboardHandler  kh         = new KeyboardHandler(new CustomKeyboardBindingMap(actionList));
            MouseHandler     mh         = new MouseHandler(new CustomMouseBindingMap(actionList), true);

            _input = new InputManager(kh, mh);

            _logic.Start();

            base.Initialize();
        }
예제 #2
0
 public CustomGraphicGenerator(CustomContentLoader loader)
 {
     this._loader = loader;
 }