/******** Functions ********/ public RushState(GameStateManager gameStateManager) : base(gameStateManager) { rushMap = new Map.RushMap(map.size.Width, map.size.Height); difficulty = 30; // Health bar. healthBar = new Layout.Bar("healthBar"); healthBar.maxValue = rushMap.playerBase.health; healthBar.percentFull = 100; healthBar.caption = ""; healthBar.status = ""; healthBar.fill = Brushes.Red; healthBar.percentageY = 93; healthBar.anchor = Layout.Anchor.CenterX; healthBar.percentageSize = new SizeF(20, 5); healthBar.padding = 1; healthBar.borderLine.Width = 3; // Difficulty counter. difficultyBox = new Layout.Textbox("difficultyBox"); difficultyBox.percentageY = 2; difficultyBox.anchor = Layout.Anchor.CenterX; layout.AddBox(difficultyBox); layout.AddBox(healthBar); }
/// <summary> /// Executed every time the gamestate is activated. /// </summary> public override void Init() { base.Init(); rushMap = new Map.RushMap(map.size.Width, map.size.Height); healthBar.maxValue = rushMap.playerBase.health; healthBar.percentFull = 100; difficulty = 30; }
/******** Functions ********/ /// <summary> /// Creates a new entity that is specialized for RushMode. /// </summary> /// <param name="rectangle">The rectangle representing the entity.</param> /// <param name="brush">The Brush to fill the entity.</param> /// <param name="map">The map the entity is moving on.</param> public RushEntity(RectangleF rectangle, Brush brush, Map.RushMap map) : base(rectangle, brush, map) { rushMap = ((Map.RushMap)base.map); ChangeTarget(); }