예제 #1
0
        private void initialize()
        {
            HealthBar = new Gauge(_gameState,
                                  this.Location.X + this.Size.Width,
                                  this.Location.Y,
                                  100,
                                  10,
                                  Color.Yellow,
                                  Color.Red,
                                  true);

            this.MaxHealth = StartingValues.UniversityMaxHealth;
            this.Health = this.MaxHealth;
        }
예제 #2
0
 private void initialize(GameState gameState)
 {
     speed = gameState.randNumberGenerator.Next(StartingValues.EnemyMinSpeed, StartingValues.EnemyMaxSpeed);
     CalculateVelocity(gameState, this.speed);
     this.HealthBar = new Gauge(gameState,
                                this.Location.X,
                                this.Location.Y + 38 + 3,
                                38,
                                38/ 6,
                                Color.Yellow,
                                Color.Red,
                                false);
     this.HealthBar.Velocity = this.Velocity;
 }
예제 #3
0
        internal void Initialize()
        {
            //Initialize and start the timer
            _lastTime = 0.0;
            _timer.Reset();
            _timer.Start();

            //Generate the first random number used to spawn enemies
            randNumber = randNumberGenerator.Next(this.minSpawnTime, this.maxSpawnTime);

            //Create all the main gameobjects
            GameObjects.Clear();

            //Create Arcane University
            float universitySize = 150;
            University university = new University(this, TotalWindowArea.Width/2 - universitySize/2,
                                                   TotalWindowArea.Height/2 + TotalWindowArea.Height/50,
                                                   universitySize,
                                                   universitySize);

            //Create Mana Bar
            float manabarSize = universitySize;
            manaBar = new Gauge(this, TotalWindowArea.Width / 2 - manabarSize/2,
                                University.Location.Y + (University.Size.Height/1.3f),
                                manabarSize, 10, Color.Blue, Color.Transparent, false);
        }