Esempio n. 1
0
        protected override void Initialize()
        {
            Console.Initialise();
            CoroutineManager.Initialise();

            Graphics.PreferredBackBufferWidth  = GAME_WIDTH * 3;
            Graphics.PreferredBackBufferHeight = GAME_HEIGHT * 3;
            Graphics.ApplyChanges();
            UpdateScaleViewport();

            entityManager = new EntityManager(this);
            Audio         = new AudioManager(this);
            Input         = new InputManager(this);

            KeyInput = new TextInput(this);

            Player = new Entity(entityManager, "player");
            Player.AddComponents(new List <Component>()
            {
                new InputTransformComponent(),
                new PositionComponent(),
                new PlayerComponent(),
                new CollisionComponent(new Resolve.RectangleF(-6, -20, 12, 24))
            });

            Camera = new Camera(this);
            Camera.SetTarget(Player);
            MapManager = new MapManager(this, Player);

            ScriptingManager = new ScriptingManager(this);
            Transition       = new TransitionManager(this);

            renderTarget1 = new RenderTarget2D(this.GraphicsDevice, GAME_WIDTH, GAME_HEIGHT);
            renderTarget2 = new RenderTarget2D(this.GraphicsDevice, GAME_WIDTH, GAME_HEIGHT);

            //IEnumerator t = Test();
            //CoroutineManager.StartCoroutine(t);

            base.Initialize();
        }