Ejemplo n.º 1
0
        public MapEditorState(Game game, EditorModel model)
            : base(game)
        {
            this.model = model;
            model.AddListener(this);

            display = game.Display;
            renderer = display.Renderer;
            input = game.Input;

            model.Display = display;
            model.Zoom = display.Zoom;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Initialize the game: Initialize display, load resources etc.
        /// </summary>
        /// <param name="width">
        /// A <see cref="System.Int32"/>
        /// </param>
        /// <param name="height">
        /// A <see cref="System.Int32"/>
        /// </param>
        /// <param name="fullscreen">
        /// A <see cref="System.Boolean"/>
        /// </param>
        public void Initialize(int width, int height, bool fullscreen, string windowTitle)
        {
            Log.Write("Engine initializing at " + DateTime.Now);
            gameStates = new List<GameState>();

            //Create resource manager and load resources from the main resource file
            resourceManager = new ResourceManager();
            resourceManager.LoadResources("data");
            //resourceManager.LoadResourceXML(ResourceManager.MainResourceFile);

            //Create the opengl display
            display = new Display();
            display.Initialize(width, height, resourceManager, windowTitle);
            if (fullscreen)
            {
                display.Fullscreen = true;
            }

            input = new InputManager();
            audioManager = new AudioManager(resourceManager);

            timer.Start();
            SimulationSpeed = DefaultSimulationSpeed;
        }
Ejemplo n.º 3
0
 public PlayerController(InputManager inputManager)
 {
     input = inputManager;
 }