public Game1() { graphics = new GraphicsDeviceManager(this); graphics.PreferredBackBufferWidth = (int)BattleConstants.SCREEN_WIDTH; graphics.PreferredBackBufferHeight = (int)BattleConstants.SCREEN_HEIGHT; graphics.IsFullScreen = false; // for now. Content.RootDirectory = "Content"; // Initialise menu Vector2 menuPosition = new Vector2( 1f/16f*BattleConstants.SCREEN_WIDTH, 8f/9f*BattleConstants.SCREEN_HEIGHT); BattleMenu actionsMenu = new BattleMenu( this, new[] {"Attack", "Position", "Done"}, menuPosition); BattleMenu positionMenu = new BattleMenu( this, new[] {"Charge", "Stay", "Keep Distance", "Run Away", "Done"}, menuPosition); BattleMenu rangeMenu = new BattleMenu( this, new[] {"1m", "2m", "3m", "5m", "8m", "13m", "Done"}, menuPosition); menus[(int)InputState.ActionSelect] = actionsMenu; menus[(int)InputState.PositionSelect] = positionMenu; menus[(int)InputState.RangeSelect] = rangeMenu; foreach (BattleMenu menu in menus) { if (menu != null) { menu.Visible = false; Components.Add (menu); } } endGameMenu = new BattleMenu( this, new[] { "Play Again?", "Quit" }, menuPosition); Components.Add(endGameMenu); statsMenu = new StatsMenu(this); this.IsMouseVisible = true; }
public Game1() { graphics = new GraphicsDeviceManager(this); graphics.PreferredBackBufferWidth = (int)BattleConstants.SCREEN_WIDTH; graphics.PreferredBackBufferHeight = (int)BattleConstants.SCREEN_HEIGHT; graphics.IsFullScreen = false; // for now. Content.RootDirectory = "Content"; // Initialise menu Vector2 menuPosition = new Vector2( 1f/16f*BattleConstants.SCREEN_WIDTH, 8f/9f*BattleConstants.SCREEN_HEIGHT); menus[(int)InputState.OffensiveSelect] = new BattleMenu( this, new[] {"Attack", "Skills", "Items", "Defense", "Escape", "Back"}, menuPosition); menus[(int)InputState.DefensiveSelect] = new BattleMenu( this, new[] {"Guard", "Skills", "Items", "Offense", "Escape", "Back"}, menuPosition); menus[(int)InputState.SkillSelect] = new BattleMenu(this, new[]{"Back"}, menuPosition); menus[(int)InputState.ItemSelect] = new BattleMenu(this, new[]{"Back"}, menuPosition); menus[(int)InputState.TargetSelect] = new BattleMenu(this, new[]{"Back"}, menuPosition); foreach (BattleMenu menu in menus) { if (menu != null) { menu.Visible = false; Components.Add (menu); } } endGameMenu = new BattleMenu( this, new[] { "Play Again?", "Quit" }, menuPosition); Components.Add(endGameMenu); queue = new BattleQueue(this, playerTeam, enemyTeam, 10); Components.Add (queue); statsMenu = new StatsMenu(this); this.IsMouseVisible = true; }