protected override void Initialize() { spriteBatch = new SpriteBatch(GraphicsDevice); input = new InputManager(); screens = new List<Screen>(); toBeRemoved = new List<Screen>(); activeScreens = new List<Screen>(); titleScreen = new TitleScreen(); titleScreen.Event += new TitleScreen.EventHandler(MenuEventHandler); //activeScreens.Add(gameScreen); activeScreens.Add(titleScreen); screens.Add(titleScreen); //graphics.ToggleFullScreen(); #if XBOX graphics.PreferredBackBufferWidth = 1280; graphics.PreferredBackBufferHeight = 720; #else graphics.PreferredBackBufferHeight = Settings.SCREEN_HEIGHT; graphics.PreferredBackBufferWidth = Settings.SCREEN_WIDTH; #endif graphics.ApplyChanges(); foreach (Screen screen in screens) screen.Initialize(Services); base.Initialize(); }
public LevelManager(int stageWidth, int stageHeight) { mCollideables = new List<Rectangle>(); mBoundingBox = new List<Rectangle>(); mSprites = new List<Sprite>(); mUnits = new List<Unit>(); eCurrLevel = CurrentLevel.None; mGoal = Rectangle.Empty; mInput = new InputManager(); mInput.Alias("left", Keys.A); mInput.Alias("right", Keys.D); mInput.Alias("up", Keys.W); mInput.Alias("down", Keys.S); mInput.Alias("action", Keys.Space); StageHeight = stageHeight; StageWidth = stageWidth; }