//擦弹判定(如果存在擦弹则返回一个坐标信息【道具出现的坐标信息】,返回的道具结果) public bool MissBullet(Player p, ref Vector2D position , ref Item itm) { if (MissTick < MissRefresh) return false; double x = p.GetX(); double y = p.GetY(); //获取到玩家坐标 double MissJudgeDistance = 15; //擦弹判定距离 if (p.CurrentCharactor.Name == "da") //不同人物具有不同的擦弹判定距离 { MissJudgeDistance = 25; } if (MissJudge(MissJudgeDistance, x, y ,ref position , ref itm)) { MissTick = 0; //擦弹计时器清零(重新进入计时周期) return true; } return false; }
StateSystem _system; // 状态机 #endregion Fields #region Constructors public Stage1State(StateSystem system , TextureManager texturemanager , SoundManagerEx soundmanager ,Form1 form = null) { _system = system; _textureManager = texturemanager; _soundmanager = soundmanager; if(form != null) this.form = form; GamePlayer = new Player(); Datas.CurrentPlayer = GamePlayer; gameview = new GameView(texturemanager, soundmanager, 5 , GamePlayer); //中间层着色,注册角色 GamePlayer.RegisteredRCharactors(Datas.Charactors[Datas.Fore_People_Select], Datas.Charactors[Datas.Fore_People_Select]);// Form1.Charactors[Datas.Back_People_Select]); GamePlayer.Position.Y = 30; GamePlayer.RenderSpeed = 0.075f; //人物帧动画渲染速度 foretable = new ForeTable(texturemanager, 10); //最前层着色 foretable.HighScores = 0; foretable.Power = 0; foretable.Graze = 0; foretable.CurrentPoint = 0; foretable.LevelPoint = 1550; foretable.CurrentTims = 0; foretable.TotleTims = 6400; foretable.GameLevel = 1; Logo = new Sprite(); Logo.Texture = texturemanager.Get("logo1"); Logo.SetWidth(192); Logo.SetHeight(192); Logo.SetPosition(210, -130); test = new Extra.VariableSprite(); test.BindSprite(Logo); test.SetAttribute(210, -130, 0, 192, 192); fonc = new FontAciHuaKang(texturemanager); TextWriter = new FontWriterTool(fonc); }