/// <summary> /// The constructor for the CharacterSelectionScreen /// </summary> public ContinueNewGameScreen(GraphicsDeviceManager graphics, DungeonCrawlerGame game) { // Get the game reference this.game = game; // Set up the viewport vars viewport = graphics.GraphicsDevice.Viewport; center = new Vector2(viewport.Width / 2, viewport.Height / 2); gameSavePosition = center - new Vector2(viewport.Width / 4, 0); // Set the colors and cursor vars selected = Color.White; unselected = Color.White * (1f / 2); controllerDelay = 100f; selectedCursorAlpha = 0.7f; cursorMoved = false; players = new List <CharSelectPlayer>(); cursorPositions = new Vector2[] { new Vector2(viewport.Width * 0.8f, viewport.Height * 0.2f), new Vector2(viewport.Width * 0.8f, viewport.Height * 0.4f), new Vector2(viewport.Width * 0.8f, viewport.Height * 0.6f), new Vector2(viewport.Width * 0.8f, viewport.Height * 0.8f), }; // Initialize the sprite arrays buttons = new ImageSprite[2, 3]; buttonTexts = new TextSprite[2, 3]; buttonAggregates = new Aggregate[2, 3]; // Initialize the sprite batch spriteBatch = new SpriteBatch(graphics.GraphicsDevice); gameSaves = new List <CharSelectPreview>(); CharacterSelectionScreen = new CharacterSelectionScreen(graphics, game); }
/// <summary> /// The constructor for the CharacterSelectionScreen /// </summary> public ContinueNewGameScreen(GraphicsDeviceManager graphics, DungeonCrawlerGame game) { // Get the game reference this.game = game; // Set up the viewport vars viewport = graphics.GraphicsDevice.Viewport; center = new Vector2(viewport.Width / 2, viewport.Height / 2); gameSavePosition = center - new Vector2(viewport.Width / 4, 0); // Set the colors and cursor vars selected = Color.White; unselected = Color.White * (1f / 2); controllerDelay = 100f; selectedCursorAlpha = 0.7f; cursorMoved = false; players = new List<CharSelectPlayer>(); cursorPositions = new Vector2[] { new Vector2(viewport.Width * 0.8f, viewport.Height * 0.2f), new Vector2(viewport.Width * 0.8f,viewport.Height * 0.4f), new Vector2(viewport.Width * 0.8f,viewport.Height * 0.6f), new Vector2(viewport.Width * 0.8f,viewport.Height * 0.8f), }; // Initialize the sprite arrays buttons = new ImageSprite[2, 3]; buttonTexts = new TextSprite[2, 3]; buttonAggregates = new Aggregate[2, 3]; // Initialize the sprite batch spriteBatch = new SpriteBatch(graphics.GraphicsDevice); gameSaves = new List<CharSelectPreview>(); CharacterSelectionScreen = new CharacterSelectionScreen(graphics, game); }
/// <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() { AggregateFactory = new AggregateFactory(this); // Initialize Components PlayerComponent = new PlayerComponent(); LocalComponent = new LocalComponent(); RemoteComponent = new RemoteComponent(); PositionComponent = new PositionComponent(); MovementComponent = new MovementComponent(); MovementSpriteComponent = new MovementSpriteComponent(); SpriteComponent = new SpriteComponent(); DoorComponent = new DoorComponent(); RoomComponent = new RoomComponent(); HUDSpriteComponent = new HUDSpriteComponent(); HUDComponent = new HUDComponent(); CharacterSelectionScreen = new CharacterSelectionScreen(graphics, this); LevelManager = new LevelManager(this); base.Initialize(); }