public override void Update() { if (GameOver.Visible == true || Victory.Visible == true) { // MyCue.Stop(AudioStopOptions.Immediate); } SpeedUpShader.BackOffset.X = Hero.BackOffset.X - 80; SpeedUpShader.BackOffset.Y = Hero.BackOffset.Y + 32; SpeedUpShader.ShowingRect = SpeedUpShader.SourceRect(SpeedUpShader); HitShader.BackOffset.X = Hero.BackOffset.X - 70; HitShader.BackOffset.Y = Hero.BackOffset.Y - 55; HitShader.ShowingRect = HitShader.SourceRect(HitShader); // TestBox1.Text = "The Boss HP is:" + Boss.HP.ToString() + " the Hero Speed is:" + Bus.SPX.ToString() + "\n The Hero HP is:" + Hero.HP.ToString() + "\n the explode visible:" + explode.Visible.ToString() // + "\n the enemyKilledCoount:" + enemyKilledCount.ToString() + "\n Boss visible:" + Boss.Visible.ToString() + "\n The shootStyle:" + ShootStyle.ToString() + loopCount.ToString()+"\n"+HeroHighRunning.Visible.ToString()+generateElectric.Visible.ToString()+ // Electric.Visible.ToString()+ reduceElectric.Visible.ToString()+ Fire.Visible.ToString()+ xinyue.Visible.ToString()+ // SikiAttackSkillEffect1.Visible.ToString()+SikiAttackSkillEffect2.Visible.ToString()+HeroAttackSkill1.Visible.ToString()+HeroAttackSkill2.Visible.ToString()+ lianxuzhan.Visible.ToString()+"\n the enemy1 visible:"+Enemy1[0].Visible.ToString()+ // "\n the enemy[1] visible:"+Enemy1[1].Visible.ToString()+"\n the enemy[2] visible"+Enemy1[2].Visible.ToString()+"\n the enemy[3] visible"+Enemy1[3].Visible.ToString()+"\n the enemy[4] visible"+Enemy1[4].Visible.ToString()+"\n the enemy[5] visible"+Enemy1[5].Visible.ToString() // +"\n the enemy[6] vislble"+Enemy1[6].Visible.ToString()+"\n the enemy[7] visible"+Enemy1[7].Visible.ToString()+"\n the enemy[8] visible"+Enemy1[8].Visible.ToString(); //TestBox2.Text = "the enemyPositionY:" + EnemyPositionY[0].ToString() + "\n" + EnemyPositionY[1].ToString() + "\n" + EnemyPositionY[2].ToString() + "\n" + // EnemyPositionY[3].ToString() + "\n" + EnemyPositionY[4].ToString() + "\n" + EnemyPositionY[5].ToString() + "\n" + EnemyPositionY[6].ToString() + "\n" + EnemyPositionY[7].ToString()+ // "\n the gameTime;" + enemySp.ToString() + "\n the BossHPDec:" + BossHPDec.ToString() + "\n thie heroHPDec:" + HeroHPDec1.ToString() + "the boss PositionX:" + Boss.BackOffset.X.ToString() + "the SessionIndex" + SessionIndex.ToString() + "the isGotoHP90Talk" + isGotoHP90Talk.ToString() + "Continue.SPX" + Continue.SPX.ToString() + "\n Continue.Visible" + Continue.Visible.ToString(); //TestBox2.Text = "the isGotoHP90Talk" + isGotoHP90Talk.ToString() + "Continue.SPX" + Continue.SPX.ToString() + "\n Continue.Visible" + Continue.Visible.ToString() + "the SessionIndex" + SessionIndex.ToString(); //if (isHeroNiuBility == true) //{ // TextBox3.Text = "主角无敌时间!"; //} //if (isHeroNiuBility == false) //{ // TextBox3.Text = ""; //} // if (isBossNiubility == true) // { // TextBox4.Text = "BOSS无敌时间!"; // } // if (isBossNiubility ==false) // { // TextBox4.Text = ""; // } if (GameName.Visible == true) { if (GameName.iCount == 0) { Audio.BGMPlay("koulin1", false); } GameName.iCount++; if (GameName.iCount == 200) { GameName.Visible = false; Ready.Visible = true; GameName.iCount = 0; } } if (Ready.Visible == true) { if (Ready.iCount == 0) { Audio.BGMPlay("koulin2", false); } Ready.iCount++; if (Ready.iCount == 100) { Ready.Visible = false; //MyCue.Play(); Hero.isStart = true; //开始播放背景音乐 //Audio.BGMPlayLoop("bella_ciao.wav", new TimeSpan(0, 0, 0, 11, 171), new TimeSpan(0, 0, 2, 45, 270)); Audio.BGMPlay("one", false); //MediaPlayer.Play(bgMusic); //Audio.SEPlay("one"); } } if (Victory.Visible == true) { BackGround.Alpha -= 0.01f; BackGround1.Alpha = BackGround.Alpha; FarBackGround1.Alpha = BackGround.Alpha; FarBackGround2.Alpha = BackGround.Alpha; Boss1Killed.Alpha = BackGround.Alpha; Boss2Killed.Alpha = BackGround.Alpha; if (BackGround.Alpha <= 0) { Hero.Visible = false; BackGround1.Visible = false; BackGround.Visible = false; FarBackGround1.Visible = false; FarBackGround2.Visible = false; Boss2Killed.Visible = false; Boss1Killed.Visible = false; if (CommonItem.Scene != null) { CommonItem.Scene.Dispose(); } CommonItem.Scene = Activator.CreateInstance(typeof(Programs.Scenes.EndScene)) as Scene_Base; } } if (GameOver.Visible == true) { if (GameOver.iCount == 0) { Audio.BGMPlay("koulin4", false); } GameOver.iCount = 1; } if (loopCount == 52) { Audio.BGMPlay("two", true); //bgMusic = CommonItem.Content.Load<Song>(@"GameContent\Sounds\BGM\two.wav"); //MediaPlayer.IsRepeating = true; //MediaPlayer.Play(bgMusic); loopCount++; } // if (Input.Press(Keys.Enter) || Ready.Visible == false && GameName.Visible == false && Victory.Visible == false && GameOver.Visible == false) // { // Hero.isStart = true; // } //按空格键暂停游戏 if (Input.Trigger(Keys.Space) || CommonItem.gamePadState.Buttons.Start == ButtonState.Pressed && CommonItem.preGamePadState.Buttons.Start == ButtonState.Released) { Audio.SEPlay("16"); time++; if (time % 2 == 1) { //MyCue.Pause(); Audio.BGMPause(); //MediaPlayer.Pause(); Hero.isStart = false; zhaoshibiao.Visible = true; } else { //MyCue.Resume(); Audio.BGMResume(); //MediaPlayer.Resume(); Hero.isStart = true; zhaoshibiao.Visible = false; zhaoshibiao.BackOffset = new Vector2(0, 0); } } //招式表的移动 if (zhaoshibiao.Visible == true) { if (Input.Press(Keys.Up)) { zhaoshibiao.SPX += 0.3f; zhaoshibiao.BackOffset.Y += zhaoshibiao.SPX; } if (Input.Press(Keys.Down)) { zhaoshibiao.SPX += 0.3f; zhaoshibiao.BackOffset.Y -= zhaoshibiao.SPX; } if (Input.Press(Keys.Right)) { zhaoshibiao.SPX += 0.3f; zhaoshibiao.BackOffset.X -= zhaoshibiao.SPX; } if (Input.Press(Keys.Left)) { zhaoshibiao.SPX += 0.3f; zhaoshibiao.BackOffset.X += zhaoshibiao.SPX; } if (!Input.Press(Keys.Up) && !Input.Press(Keys.Down) && !Input.Press(Keys.Right) && !Input.Press(Keys.Left)) { zhaoshibiao.SPX = 2; } zhaoshibiao.BackOffset.X = MathHelper.Clamp(zhaoshibiao.BackOffset.X, -(zhaoshibiao.SourceTexture.Width - Prefs.WindowSizeW), 0); zhaoshibiao.BackOffset.Y = MathHelper.Clamp(zhaoshibiao.BackOffset.Y, Prefs.WindowSizeH - zhaoshibiao.SourceTexture.Height, 0); } //按P键跳过杂兵直接打Boss if (Input.Trigger(Keys.P)) { loopCount = 50; enemySp = 6800; } //按下K键进行时间停止3 if (Input.Trigger(Keys.K)) { isTimeStop = true; isTimeStop3 = true; //mountain.StartRedShadow(mountain.BackOffset); } //按下L键进行时间停止2 if (Input.Trigger(Keys.L)) { isTimeStop2 = true; } //按下O键进行时间停止 if (Input.Trigger(Keys.O)) { isTimeStop = true; //FarBackGround1.StartRedShadow(Boss.BackOffset); //FarBackGround2.StartRedShadow(Boss.BackOffset); //BackGround.StartRedShadow(Boss.BackOffset); //BackGround1.StartRedShadow(Boss.BackOffset); //Bus.StartRedShadow(Boss.BackOffset); //Bus1.StartRedShadow(Boss.BackOffset); } if (isTimeStop == false) { //FarBackGround1.EndRedShadow(); //FarBackGround2.EndRedShadow(); //BackGround.EndRedShadow(); //BackGround1.EndRedShadow(); //Bus.EndRedShadow(); //Bus1.EndRedShadow(); } //主角和Boss伤害控制 if (Input.Trigger(Keys.F1)) { HeroHPDec1 += 100; BossHPDec += 100; } if (Input.Trigger(Keys.F2)) { HeroHPDec1 -= 100; BossHPDec -= 100; } if (Hero.isStart == true) { //Hero加速 HeroHighRunning.Z = Hero.BackOffset.Y + 223; Hero.Z = Hero.BackOffset.Y + 224; Boss.Z = Boss.BackOffset.Y + 249; BossShooting.Z = BossShooting.BackOffset.Y + 249; HeroAttacked.Z = HeroAttacked.BackOffset.Y + 250; HitShader.Z = Hero.Z + 1; BackGroundUpdate(); PortraitUpdate(); HeroUpdate(); SikiUpdate(); Enemy1BackOffsetUpdate(); enemyUpdateTime++; BossUpdate(); BossPositionUpdate(); SoundsUpdate(); BossShootUpdate(); enemyKilledUpdate(); if (enemyUpdateTime == 20) { Enemy1Update(); enemyUpdateTime = 0; } enemyIsMoveUpdate(); } #region 返讨 if (GameOver.Visible == true) { BackToHitBoss.Visible = true; BackToRestart.Visible = true; if (Cursor.iCount == 0) { Cursor.Visible = true; } if (Input.Trigger(Keys.Up)) { Cursor.BackOffset.Y = BackToHitBoss.BackOffset.Y; } if (Input.Trigger(Keys.Down)) { Cursor.BackOffset.Y = BackToRestart.BackOffset.Y; } if (Input.Trigger(Keys.Q) || Input.Trigger(Keys.W)) { Cursor.Visible = false; } if (Cursor.Visible == false) { Cursor.iCount++; if (Cursor.iCount >= 60) { Cursor.iCount = 0; if (Cursor.BackOffset.Y == BackToHitBoss.BackOffset.Y) { //返回去大Boss Audio.SEPlay("24"); Hero.HP = 1000; Hero.Shader.Visible = true; Hero.isStart = true; Hero.Visible = true; Hero.BackOffset = new Microsoft.Xna.Framework.Vector2(300, 300); HeroKilled.Visible = false; HeroKilledShader.Visible = false; Boss.Visible = true; Boss1Killed.Visible = false; Boss2Killed.Visible = false; GameOver.Visible = false; Boss.BackOffset.X = 1280; BackToHitBoss.Visible = false; BackToRestart.Visible = false; Cursor.Visible = false; Audio.BGMPlay("two", true); } if (Cursor.BackOffset.Y == BackToRestart.BackOffset.Y) { //返回重新开始游戏 //Hero.HP = 1000; //loopCount = 0; //enemyKilledCount = 0; //enemyOverCount = 0; //Hero.Shader.Visible = true; //Boss.Visible = false; //Boss.BackOffset.X = 1280; //HeroKilled.Visible = false; //HeroKilledShader.Visible = false; //Hero.isStart = true; //enemySp = 0; //Hero.Visible = true; //Hero.BackOffset = new Microsoft.Xna.Framework.Vector2(300, 300); //GameOver.Visible = false; //BackToHitBoss.Visible = false; //BackToRestart.Visible = false; //Cursor.Visible = false; //Audio.BGMPlay("one",true); Audio.SEPlay("23"); CommonItem.isPalyed = true; if (CommonItem.Scene != null) { CommonItem.Scene.Dispose(); } CommonItem.Scene = Activator.CreateInstance(typeof(Programs.Scenes.StartScene)) as Scene_Base; } } } } #endregion base.Update(); }
private void HeroUpdate() { HeroHighRunning.CollisionRect = Hero.CollisionRect; //主角HP同步 HeroHP_01.ShowingRect = new Rectangle(0, 0, (int)(HeroHP_01.SourceTexture.Width * (((float)Hero.HP / 1000))), HeroHP_01.SourceTexture.Height); //被撞敌人百分比 enemyKilledPercentBox.Text = (int)(((float)(enemyKilledCount) / 75) * 100) + @"%"; misssEnemypercentBox.Text = (int)(((float)(enemyOverCount) / 75) * 100) + @"%"; //时间停止 if (isTimeStop == true) { Hero.SPX = timeStopBackSPX; Hero.BackOffset.X += Hero.SPX; } //主角防御状态下被攻击时火花位置同步 HeroDefenseShooted_fire.BackOffset = Hero.BackOffset; //主角攻击状态的位置同步 HeroAttack1.BackOffset = Hero.BackOffset; HeroAttack2.BackOffset = Hero.BackOffset; HeroAttack1.Z = HeroHighRunning.Z + 1; HeroAttack2.Z = HeroHighRunning.Z + 1; if (loopCount > maxloopCount) { //主角防御 HeroDefense.ShowingRect = HeroDefense.SourceRect(HeroDefense); if (Input.Press(Keys.Q) && Input.Press(Keys.W)) { HeroDefense.BackOffset = Siki.BackOffset; HeroDefense.Z = HeroHighRunning.Z + 1; HeroDefense.Alpha = Siki.Alpha; HeroDefense.Visible = true; Siki.Visible = false; isHeroDefense = true; HeroDefense.iCount++; if (HeroDefense.iCount == theHeroDefenseFrame)//6 { HeroDefense.CurrentPositionY++; HeroDefense.iCount = 0; if (HeroDefense.CurrentPositionY == 3) { HeroDefense.CurrentPositionY = 2; } HeroDefense.ShowingRect = HeroDefense.SourceRect(HeroDefense); } } if (!Input.Press(Keys.Q) || !Input.Press(Keys.W)) { if (isHeroDefense == true) { HeroDefense.iCount++; if (HeroDefense.iCount == 6) { HeroDefense.iCount = 0; HeroDefense.CurrentPositionY--; HeroDefense.ShowingRect = HeroDefense.SourceRect(HeroDefense); if (HeroDefense.CurrentPositionY == 0) { HeroDefense.Visible = false; Siki.Visible = true; isHeroDefense = false; } } HeroDefenseTime++; if (HeroDefenseTime >= 10) { isHeroDefense = false; HeroDefenseTime = 0; HeroDefense.CurrentPositionY = 0; HeroDefense.ShowingRect = HeroDefense.SourceRect(HeroDefense); } } if (isHeroDefense == false) { HeroDefense.Visible = false; Siki.Visible = true; HeroDefense.CurrentPositionY = 0; HeroDefense.ShowingRect = HeroDefense.SourceRect(HeroDefense); } } } if (isHeroDefense == true) { HeroDefenseShooted_fire.BackOffset = Hero.BackOffset; if (HeroDefenseShooted_fire.Visible == true) { HeroDefenseShooted_fire.iCount++; if (HeroDefenseShooted_fire.iCount == theHeroDefenseShootedFrame)//6) { HeroDefenseShooted_fire.ObjectAnimation(HeroDefenseShooted_fire); HeroDefenseShooted_fire.iCount = 0; } } } if (HeroHighRunning.Visible == false) { HeroDefenseShooted_fire.Visible = false; } if (HeroKilled.Visible == true) { HeroHighRunning.Visible = false; } //主角牛逼时间 if (isHeroNiuBility == true) { HeroNiubilityTime++; if (HeroNiubilityTime >= 20) { HeroNiubilityTime = 0; isHeroNiuBility = false; } } HeroHighRunning.BackOffset = Hero.BackOffset; if (HeroAttacked.Visible == false && Hero.Visible == false && HeroHighRunning.Visible == false) { Hero.Shader.Visible = false; } Hero.Shader.BackOffset = Hero.BackOffset; HeroAttacked.BackOffset = Hero.BackOffset; Hero.iCount++; if (Hero.isSpeedChange == true) { SpeedChange(Hero, true, 10, 0.01f); } if (Bus.SPX >= 10 && HeroAttacked.Visible == false && Hero.HP > 0) { Hero.Visible = false; HeroHighRunning.Visible = true; } if (Bus.SPX < 10 && HeroAttacked.Visible == false) { Hero.Visible = true; HeroHighRunning.Visible = false; } if (Hero.HP <= 0 && explode2.isPool == true) { HeroHighRunning.Visible = false; Hero.Visible = true; } if (Hero.HP <= 0 && Hero.Visible == true && explode2.isPool == true) { if (isExplodeSoundStart == false) { isExplodeSoundStart = true; //Audio.SEPlay("05"); } HeroGoToCenter(Hero); HeroKilling.BackOffset = Hero.BackOffset; HeroKilling.BackOffset.Y = Hero.BackOffset.Y + 100; Hero.HP = 0; Boss.BackOffset.X += 5; explode2.Visible = true; explode2.iCount++; explode2.BackOffset = Hero.BackOffset; explode2.ShowingRect = explode2.SourceRect(explode2); if (explode2.iCount == 2) { explode2.SPX++; explode2.ObjectAnimation(explode2); if (explode2.SPX == 30) { Hero.Visible = false; explode2.Visible = false; explode2.isPool = false; explode2.SPX = 0; LastExplode1.Visible = true; LastExplode2.HP = 2; Audio.SEPlay("05"); } explode2.iCount = 0; } if (Bus.SPX > 0) { BackGround.SPX -= BackGroundSPXDec; if (BackGround.SPX <= 0) { BackGround.SPX = 0; } Bus.SPX -= (BusSPXDec); } } if (LastExplode2.isPool == false && LastExplode2.HP == 2) { FarBackGround1.SPX = 0; if (Bus.SPX > 0) { BackGround.SPX -= BackGroundSPXDec; if (BackGround.SPX <= 0) { BackGround.SPX = 0; Bus.SPX -= (BusSPXDec - 0.01f); } } Hero.Visible = false; HeroKilling.Visible = true; HeroKilledShader.BackOffset.X = HeroKilling.BackOffset.X + 10; HeroKilledShader.BackOffset.Y = Bus.BackOffset.Y + (Hero.BackOffset.Y - (Prefs.WindowSizeH - 528)) + 130; HeroKilledShader.Visible = true; if (Hero.isStart == true) { HeroKilling.iCount += 0.01f; if (HeroKilling.isStart == false) { Bus.BackOffset.Y = (Prefs.WindowSizeH - 528) + 250 * HeroKilling.iCount - 50 * HeroKilling.iCount * HeroKilling.iCount; Bus1.BackOffset.Y = (Prefs.WindowSizeH - 528) + 250 * HeroKilling.iCount - 50 * HeroKilling.iCount * HeroKilling.iCount; BackGround.BackOffset.Y = 100 * HeroKilling.iCount - 25 * HeroKilling.iCount * HeroKilling.iCount - 200; BackGround1.BackOffset.Y = 100 * HeroKilling.iCount - 25 * HeroKilling.iCount * HeroKilling.iCount - 200; if (100 * HeroKilling.iCount > 250 && 80 * HeroKilling.iCount < 380) { if (isHeroHitLand == false) { isHeroHitLand = true; Audio.SEPlay("03"); } HeroKilling.CurrentPositionX = 2; HeroKilling.ShowingRect = HeroKilling.SourceRect(HeroKilling); } if (100 * HeroKilling.iCount >= 500) { isHeroHitLand = false; HeroKilling.CurrentPositionX = 1; HeroKilling.ShowingRect = HeroKilling.SourceRect(HeroKilling); HeroKilling.isStart = true; } } if (HeroKilling.isStart == true) { Boss.SPX = -5; if (Bus.SPX > 0) { Bus.SPX -= (BusSPXDec - 0.028f); } HeroKilled.iCount += 0.01f; if (60 * HeroKilled.iCount <= 180) { Bus.BackOffset.Y = (Prefs.WindowSizeH - 528) + 90 * HeroKilled.iCount - 30 * HeroKilled.iCount * HeroKilled.iCount; Bus1.BackOffset.Y = (Prefs.WindowSizeH - 528) + 90 * HeroKilled.iCount - 30 * HeroKilled.iCount * HeroKilled.iCount; BackGround.BackOffset.Y = 10 * HeroKilled.iCount - 2 * HeroKilled.iCount * HeroKilled.iCount - 200; BackGround1.BackOffset.Y = 10 * HeroKilled.iCount - 2 * HeroKilled.iCount * HeroKilled.iCount - 200; } if (60 * HeroKilled.iCount >= 180) { if (isHeroHitLand == false) { isHeroHitLand = true; Audio.SEPlay("03"); } HeroKilling.CurrentPositionX = 1; HeroKilling.ShowingRect = HeroKilling.SourceRect(HeroKilling); } if (60 * HeroKilled.iCount >= 200) { HeroKilled.CurrentPositionX = 0; //英雄被杀动画帧归零; HeroKilled.CurrentPositionY = 0; HeroKilling.CurrentPositionX = 0; //英雄正在被杀动画帧归零 HeroKilling.CurrentPositionY = 0; HeroKilling.ShowingRect = HeroKilling.SourceRect(HeroKilling); HeroKilled.iCount = 0;//计数器归零 HeroKilling.iCount = 0; explode2.isPool = true; LastExplode2.isPool = true; HeroKilling.isStart = false; LastExplode2.HP = 0; HeroKilled.BackOffset = HeroKilling.BackOffset; HeroKilled.BackOffset.Y = HeroKilling.BackOffset.Y + 10; HeroKilledShader.BackOffset = HeroKilled.BackOffset; HeroKilled.Visible = true; HeroKilling.Visible = false; Hero.isStart = false; GameOver.Visible = true; isHeroHitLand = false; Audio.BGMStop(); } } } } if (Hero.iCount == theHeroFrame)// 5)主角的动画帧数 { HeroAttacked.iCount++; if (HeroAttacked.Visible == true) { Hero.Shader.Visible = HeroAttacked.Visible; HeroAttacked.ObjectAnimation(HeroAttacked); } HeroHighRunning.ObjectAnimation(HeroHighRunning); Hero.ObjectAnimation(Hero); Hero.iCount = 0; } if (HeroAttacked.iCount == 15) { HeroAttacked.isPool = false; HeroAttacked.iCount = 0; } if (HeroAttack1.Visible == true) { HeroHighRunning.Visible = false; HeroAttack1.iCount++; if (HeroAttack1.iCount >= 5) { HeroAttack1.HP++; HeroAttack1.iCount = 0; HeroAttack1.ObjectAnimation(HeroAttack1); if (HeroAttack1.HP >= 6) { HeroAttack1.HP = 0; HeroAttack1.Visible = false; HeroAttack2.Visible = true; } } } if (HeroAttack2.Visible == true) { HeroAttack2.iCount++; if (HeroAttack2.iCount >= 5) { HeroAttack2.HP++; HeroAttack2.iCount = 0; HeroAttack2.ObjectAnimation(HeroAttack2); if (HeroAttack2.HP >= 10) { HeroAttack2.HP = 0; HeroAttack2.Visible = false; HeroHighRunning.Visible = true; } } } if (HeroAttacked.Visible == false && HeroKilling.Visible == false && HeroKilled.Visible == false && HeroAttack1.Visible == false && HeroAttack2.Visible == false) { HeroHighRunning.Visible = true; HeroAttacked.isPool = true; } if (HeroAttacked.Visible == true) { Boss.SPX -= 0.1f; Hero.Visible = false; SpeedChange(Hero, false, 3, 0.1f); } if (Hero.Visible == true && HeroHighRunning.Visible == true) { SpeedUpShader.Visible = true; SpeedChange(Hero, true, 10, 0.03f); } //Control Hero HitSHaders[0].iCount++; if (HitSHaders[0].iCount == 1) { foreach (var hs in HitSHaders) { hs.BackOffset.X = Hero.BackOffset.X - 70; hs.BackOffset.Y = Hero.BackOffset.Y - 55; if (hs.Visible == true) { hs.ObjectAnimation(hs); } } HitSHaders[0].iCount = 0; } SpeedUpShader.ObjectAnimation(SpeedUpShader); if (Hero.HP != 0 && Boss1Killed.Visible == false && explode.Visible == false && isHeroDefense == false && isHeroNiuBility == false && isTimeStop == false) { if (Input.Press(Keys.Down)) { Hero.BackOffset.Y += HeroUpOrDownSP;// 5f; } if (Input.Press(Keys.Up)) { Hero.BackOffset.Y -= HeroUpOrDownSP;// f; } if (Input.Press(Keys.Left)) { Hero.BackOffset.X -= HeroLeftSP;// 10f; } if (Input.Press(Keys.Right)) { SpeedUpShader.Visible = true; Hero.BackOffset.X += HeroRightSP;// 5f; } //测试Hero and Boss HP Control if (Input.Press(Keys.H)) { Hero.HP += 10; } if (Input.Press(Keys.B)) { Boss.HP += 10; } Hero.BackOffset.Y = MathHelper.Clamp(Hero.BackOffset.Y, 300f, 495f); Hero.BackOffset.X = MathHelper.Clamp(Hero.BackOffset.X, 0f, 1000f); } }