Beispiel #1
0
        /******** 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);
        }
Beispiel #2
0
        /// <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;
        }
Beispiel #3
0
        /******** 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();
        }