public override void UpdateState(GameTime gameTime) { _menuFrame.Update(gameTime); _newgameFrame.Update(gameTime); _loadgameFrame.Update(gameTime); _optionFrame.Update(gameTime); _helpFrame.Update(gameTime); _aboutFrame.Update(gameTime); _quitFrame.Update(gameTime); }
public override void UpdateState(GameTime gameTime) { //_introFrame.Update(gameTime); _introFrames.Update(gameTime); _selectMode.Update(gameTime); _aboutGameButtonFrame.Update(gameTime); _programer1ButtonFrame.Update(gameTime); _programer2ButtonFrame.Update(gameTime); _exitButtonFrame.Update(gameTime); //_introFrame.Update(gameTime); //Thang nay update cuối cùng vì neu co exit state thì no bảo đảm tất cả //các frame đều đã được update.. }
public override void Update(GameTime gameTime) { if (_boardFrame.Motion != null) { if (!_boardFrame.Motion.IsStanding) { _boardFrame.IsVisible = true; _boardFrame.Motion.Move(new Vector2(_boardFrame.X, _boardFrame.Y)); if (_boardFrame.Motion.IsStanding) { Rectangle _testVisible = new Rectangle(0, 0, GlobalVariables.ScreenWidth, GlobalVariables.ScreenHeight); Point _point1 = new Point((int)_boardFrame.X, (int)_boardFrame.Y); Point _point2 = new Point((int)_boardFrame.X + (int)_boardFrame.Width, (int)_boardFrame.Y); Point _point3 = new Point((int)_boardFrame.X, (int)_boardFrame.Y + (int)_boardFrame.Height); Point _point4 = new Point((int)_boardFrame.X + (int)_boardFrame.Width, (int)_boardFrame.Y + (int)_boardFrame.Height); if (_testVisible.Contains(_point1) || _testVisible.Contains(_point2) || _testVisible.Contains(_point3) || _testVisible.Contains(_point4)) { _boardFrame.IsVisible = true; } else { _boardFrame.IsVisible = false; } _boardFrame.OnMove_Complete(this, null); } } } //Update level của Character if (_character.Level > _preLevelOfChar) { _preLevelOfChar = _character.Level; _lhAddition++; _lbLHAddition.StringInfo = _lhAddition.ToString(); _lbLHAddition.StringColor = new Color(235, 235, 235); _rhAddition++; _lbRHAddition.StringInfo = _rhAddition.ToString(); _lbRHAddition.StringColor = new Color(235, 235, 235); //chỉ o nhung~ level lẻ, người choi mới co dc 1 diem cộng cho skill passive if ((_preLevelOfChar % 2) == 1) { _passiveAddition++; _lbPassiveAddtion.StringInfo = _passiveAddition.ToString(); _lbPassiveAddtion.StringColor = new Color(235, 235, 235); } if (_preLevelOfChar == 6) { //left hand _btSkillCurse.Endalbe = true; _btSkillOverSpeed.Endalbe = true; //right hand _btEathShakeSkill.Endalbe = true; _btWaveFormSkill.Endalbe = true; //passive _btGodStrength.Endalbe = true; } if (_preLevelOfChar == 12) { //left hand _btSkillLifeSteal.Endalbe = true; _btSkillBash.Endalbe = true; //right hand _btLightingField.Endalbe = true; _btInvisible.Endalbe = true; //passive _btBlur.Endalbe = true; } } //update các label thong bao mức cộng của skill _currentBoard.Update(gameTime); //Update thong tin cac label switch (_iCurrentBoard) { case 0: { GetSkillLevel(_lbSkillCleaving); GetSkillLevel(_lbSkillCritical); GetSkillLevel(_lbSkillCurse); GetSkillLevel(_lbSkillOverspeed); GetSkillLevel(_lbSkillLifeSteal); GetSkillLevel(_lbSkillBash); break; } case 1: { GetSkillLevel(_lbDeadlyBeesSkill); GetSkillLevel(_lbSoulRelease); GetSkillLevel(_lbEathShakeSkill); GetSkillLevel(_lbWaveFormSkill); GetSkillLevel(_lbLightingField); GetSkillLevel(_lbInvisible); break; } case 2: { GetSkillLevel(_lbbtGreatFortitude); GetSkillLevel(_lbGodStrength); GetSkillLevel(_lbBlur); break; } } _rect = new Rectangle((int)_boardFrame.X, (int)_boardFrame.Y, (int)_boardFrame.Width, (int)_boardFrame.Height); if (_rect.Contains(GlobalVariables.CurrentMouseState.X, GlobalVariables.CurrentMouseState.Y)) { GlobalVariables.AlreadyUseLeftMouse = true; GlobalVariables.AlreadyUseRightMouse = true; } }
public override void Update(GameTime gameTime) { _healbarFrame.Update(gameTime); //Update của left button skill Skill _currentLeftSkill = (Skill)_btLefthandSkill.Owner; if ((_currentLeftSkill.ListLevel[_currentLeftSkill.Level].ListSkillInfo[0].Mp * -1) <= _character.Mp) { _btLefthandSkill.ColorToDraw = Color.White; } else { _btLefthandSkill.ColorToDraw = new Color(0, 130, 185); } if (_currentLeftSkill.CheckCoolDown != 0) { float _cooldownLeftRate = (float)_currentLeftSkill.CheckCoolDown / (float)_currentLeftSkill.CoolDownTime; _coolDownLeftSkill.UpdateDrawRect(_cooldownLeftRate); } else { _coolDownLeftSkill.UpdateDrawRect(0); } //Update cua tight button skill Skill _currentRightSkill = (Skill)_btRighthandSkill.Owner; if (_currentRightSkill != null) { if ((_currentRightSkill.ListLevel[_currentRightSkill.Level].ListSkillInfo[0].Mp * -1) <= _character.Mp) { _btRighthandSkill.ColorToDraw = Color.White; } else { _btRighthandSkill.ColorToDraw = new Color(0, 130, 185); } if (_currentRightSkill.CheckCoolDown != 0) { float _cooldownRightRate = (float)_currentRightSkill.CheckCoolDown / (float)_currentRightSkill.CoolDownTime; _coolDownRightSkill.UpdateDrawRect(_cooldownRightRate); } else { _coolDownRightSkill.UpdateDrawRect(0); } } //Update của ống máu float _bloodRate = (float)_character.Hp / (float)_character.MaxHp; _bloodPro.UpdateDrawRect(_bloodRate); //update của ống mana float _manaRate = (float)_character.Mp / (float)_character.MaxMp; _manaPro.UpdateDrawRect(_manaRate); //update ống level float _levelRate = (float)_character.CurrentEXP / (float)_character.NextLevelEXP; _levelProcess.UpdateDrawRect(_levelRate); //Update so luong item _itemFrame.Update(gameTime); //trong cai update này co san~ cai update cua nhung button _lbBlood.StringInfo = _character.HPPortion.Count.ToString(); _lbMana.StringInfo = _character.MPPortion.Count.ToString(); _lbBloodNMana.StringInfo = _character.RestorePortion.Count.ToString(); //update main rect _rect = new Rectangle((int)_healbarFrame.X, (int)_healbarFrame.Y, (int)_healbarFrame.Width, (int)_healbarFrame.Height); if (_rect.Contains(GlobalVariables.CurrentMouseState.X, GlobalVariables.CurrentMouseState.Y)) { GlobalVariables.AlreadyUseLeftMouse = true; GlobalVariables.AlreadyUseRightMouse = true; } //Update chỗ này chỉ để chặn con chuột -> khá dỡ. _bloodPro.Update(gameTime); _manaPro.Update(gameTime); }
public override void Update(GameTime gameTime) { _mainFrame.Update(gameTime); _lbLevel.StringInfo = _character.Level.ToString(); _lbLevel.UpdateOffset(); _lbEXP.StringInfo = _character.CurrentEXP.ToString(); _lbEXP.UpdateOffset(); _lbNextLevel.StringInfo = _character.NextLevelEXP.ToString(); _lbNextLevel.UpdateOffset(); //Hp if (_character.Hp >= 0) { _lbCurrentHP.StringInfo = _character.Hp.ToString(); } else { _lbCurrentHP.StringInfo = (0).ToString(); } _lbCurrentHP.UpdateOffset(); _lbMaxHp.StringInfo = _character.MaxHp.ToString(); _lbMaxHp.UpdateOffset(); //Mp if (_character.Mp >= 0) { _lbCurrentMP.StringInfo = _character.Mp.ToString(); } else { _lbCurrentMP.StringInfo = (0).ToString(); } _lbCurrentMP.UpdateOffset(); _lbMaxMP.StringInfo = _character.MaxMp.ToString(); _lbMaxMP.UpdateOffset(); //damage _lbMinDamage.StringInfo = _character.MinDamage.ToString(); _lbMinDamage.UpdateOffset(); _lbMaxDamage.StringInfo = _character.MaxDamage.ToString(); _lbMaxDamage.UpdateOffset(); _lbCritRate.StringInfo = _character.CriticalRate.ToString() + "%"; _lbCritRate.UpdateOffset(); //kháng đòn _lbDefence.StringInfo = _character.Defense.ToString(); _lbDefence.UpdateOffset(); _lbDodge.StringInfo = _character.ChangeToDodge.ToString() + "%"; _lbDodge.UpdateOffset(); //move speed _lbMS.StringInfo = _character.Speed.ToString() + " MS"; _lbMS.UpdateOffset(); //portion _lbHealing.StringInfo = _character.HPPortion.Count.ToString(); _lbHealing.UpdateOffset(); _lbMana.StringInfo = _character.MPPortion.Count.ToString(); _lbMana.UpdateOffset(); _lbStore.StringInfo = _character.RestorePortion.Count.ToString(); _lbStore.UpdateOffset(); if (_mainFrame.Rect.Contains(GlobalVariables.CurrentMouseState.X, GlobalVariables.CurrentMouseState.Y)) { GlobalVariables.AlreadyUseLeftMouse = true; GlobalVariables.AlreadyUseRightMouse = true; } }